Intel-BMC/openbmc

rngd consumes CPU for a few minutes after BMC boot

Closed this issue · 9 comments

Note on Bugs
After BMC is booted (or rebooted), rngd consumes a lot of CPU for a few minutes.

Unexpected behavior you saw

# top
  318     1 root     RN   12244   2%  70% /usr/sbin/rngd -f -r /dev/hwrng

Expected behavior
rngd shall not consume so much CPU

To Reproduce
Steps to reproduce the behavior:

  1. Build intel-bmc/openbmc (either intel or update branch), flash to CRB.
  2. Boot CRB's BMC, or reboot the BMC
  3. Login to BMC's debug console, use top to check the CPU usage
  4. During a few minutes, we could see /usr/sbin/rngd process consumes a lot of CPU

Additional context
Be noted that there is a related issue in upstream: openbmc/openbmc#3574, but with the issue fixed, the rngd process still consumes CPU at start until the entropy poll is filled.

cjia4 commented

Can not reproduce it. How long could it last from your observation?

It usually takes 2~3 minutes after BMC boot/reboot.

cjia4 commented

Then it does not match what I observe. I see 70% once but it lasts only for around 1 second.

cjia4 commented

intel-BMC already contains the fix for openbmc/openbmc#3574

Then it does not match what I observe. I see 70% once but it lasts only for around 1 second.

Do you mean the CRB image or the open-sourced build?

intel-BMC already contains the fix for openbmc/openbmc#3574

Yup, this issue is a separated one. The issue in the above link is for the rngd consumes CPU forever.
This issue is for the rngd consumes CPU for a few minutes after BMC boots/reboots.

cjia4 commented

This build. intel-BMC. I built the open source image and test it on CRB.

Verified that on ca9404e the issue still occurs.
Updated a log captured from top -d1.
top.log

Be noted that after BMC reboot/boot, there are other processes consuming CPU at first, e.g. entity-manager, bmcweb, etc, and after a while (about 20~30 seconds), the services are done, and we could see rngd consuming the CPU.

cjia4 commented

Isn't it as expected that rngd is consuming CPU? Basically, it needs CPU resource to finish initialiation.
We checked that rngd service has lower priority than entity-manager, bmcweb. It matches what you observed. rngd will start to eat more resource right after these processes are ready (finishing initialization).

Right, I realize that the upstream OpenBMC has the same behavior.
Close this.