Bug 631443 - /usr/sbin/rngd using much cpu time
Summary: /usr/sbin/rngd using much cpu time
Status: RESOLVED WONTFIX
Alias: None
Product: openSUSE 11.3
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Final
Hardware: x86-64 Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Ruediger Oertel
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-16 12:38 UTC by Harald Koenig
Modified: 2013-02-06 17:38 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Koenig 2010-08-16 12:38:23 UTC
I just noticed the following process on my xen dom0 server:

# ps up 3765
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root      3765  0.7  0.0  41164   576 ?        SLsl Jul27 215:14 /usr/sbin/rngd -r /dev/hwrng --fill-watermark=90% --feed-interval=1

# uptime
 11:54am  up 19 days 17:55,  2 users,  load average: 0.00, 0.05, 0.03


syslog shows some rngd stats every hour:

Aug 16 10:00:11 os4 rngd[3765]: stats: bits received from HRNG source: 859960064
Aug 16 10:00:11 os4 rngd[3765]: stats: bits sent to kernel pool: 859174336
Aug 16 10:00:11 os4 rngd[3765]: stats: entropy added to kernel pool: 859174336
Aug 16 10:00:11 os4 rngd[3765]: stats: FIPS 140-2 successes: 42961
Aug 16 10:00:11 os4 rngd[3765]: stats: FIPS 140-2 failures: 37
Aug 16 10:00:11 os4 rngd[3765]: stats: FIPS 140-2(2001-10-10) Monobit: 4
Aug 16 10:00:11 os4 rngd[3765]: stats: FIPS 140-2(2001-10-10) Poker: 6
Aug 16 10:00:11 os4 rngd[3765]: stats: FIPS 140-2(2001-10-10) Runs: 16
Aug 16 10:00:11 os4 rngd[3765]: stats: FIPS 140-2(2001-10-10) Long run: 13
Aug 16 10:00:11 os4 rngd[3765]: stats: FIPS 140-2(2001-10-10) Continuous run: 0
Aug 16 10:00:11 os4 rngd[3765]: stats: HRNG source speed: (min=22.657; avg=62.187; max=67.579)Kibits/s
Aug 16 10:00:11 os4 rngd[3765]: stats: FIPS tests speed: (min=15.138; avg=104.967; max=109.618)Mibits/s
Aug 16 10:00:11 os4 rngd[3765]: stats: Lowest ready-buffers level: 2
Aug 16 10:00:11 os4 rngd[3765]: stats: Entropy starvations: 0
Aug 16 10:00:11 os4 rngd[3765]: stats: Time spent starving for entropy: (min=0; avg=0.000; max=0)us


that dom0 got updated from 11.1 via 11.2 to 11.3.  
rng-tools have not been installed in neither in 11.1 nor in 11.2, they showed up with the update to 11.3 (to 11.3-factory-final):

# grep  rng-tools /var/log/zypp/history 
2010-06-30 10:18:25|install|rng-tools|2-139.2|x86_64||oss|c05261ce746d39c9b2f556330b148001d1e8321c
2010-07-22 00:52:13|install|rng-tools|2-140.1|x86_64||oss|aaba142d0d171f5677c019d3ad0b3ab40ff11fa8


though there is no explicit requirement for rng-tools: "rpm -q --whatrequires rng-tools" gives no ouptut and "rpm -e ..." did not complain.

so:

- why did rng-tools get installed at all ? 
(update was done with "zypper dup", so there is only zypp/history but no y2log files...)

- why does it use so much cpu time ?

for now I just removed that package;)
Comment 1 Ruediger Oertel 2010-11-10 11:48:03 UTC
> why did rng-tools get installed at all
it was installed since the package supplements several pci ids
(basically: if the system supports it)

> why does it use so much cpu time
actually: no idea yet. might be related to running inside the dom0

this could be related:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=532391

christian: since you did the switch of rng-tools to the debian-fork:
any ideas ?
Comment 2 Cristian Rodríguez 2010-11-10 12:42:56 UTC
Known issue, new multithreaded rngd may use quite a bit a CPU time, it is related to that bug mentioned in comment 1.

Of course removing the package leaves from system with very little entropy available ;) in case you want an alternative, install "haveged" from the security repo.

I will keep an eye on this one.
Comment 3 Ruediger Oertel 2013-02-06 17:38:07 UTC
let's close this one, the package has been updated several times
and I have not seen similar reports