-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
100% CPU use when the computer is started #20
Comments
Am Samstag, 13. März 2021, 08:25:55 CET schrieb eleius:
Hi eleius,
Thanks for the report. Can you please elaborate a bit as follows:
- which version of the rngd are you using? jtterentropy-rngd -h
- when you kill the rngd, please can you report the content of /proc/sys/
kernel/random/entropy_avail - then do something with your mouse like
erratically move it a bit for a couple of seconds and report the content of
the file again (I want to check whether there is an entropy leech)
- can you start the rngd with -vvv as root (it does not daemonize, but dumps
logs, please dump the logs into this issue tracker
- if you can: when did the odd behavior start and what did you change
- if you can: can you start an older kernel and report whether you see the
same behavior?
Thanks
Stephan
|
Hi again, I tried with older kernels and the problem only appears in 5.11.3+ kernels. Version:
running with -vvv produces an endless log like this:
Then:
A couple of seconds after moving mouse and using the desktop:
A couple of minutes later I restarted jitterentropy-rngd but cpu usage was normal. I used killall and checked again:
Running with -vvv shows different a log:
Tried booting from kernel 5.11.2:
Booting kernel 5.11.3:
Booting kernel 5.11.4:
Booting 5.11.2 again:
|
Am Sonntag, 14. März 2021, 10:44:14 CET schrieb eleius:
Hi eleius,
I think I have a smoking gun.
Just for testing, can you please disable the following line in your code:
ioctl(rng->fd, RNDRESEEDCRNG) < 0 && errno != EINVAL)
Compile again and test it.
Thanks
Stephan
|
I removed the IF block (lines 272-278). It worked!
|
Am Sonntag, 14. März 2021, 17:06:23 CET schrieb eleius:
Hi eleius,
I removed the if block containing that code. It worked!
1. boot 5.11.6: 100% cpu use
2. /proc/sys/kernel/random/entropy_avail is 4
3. sudo killall jitterentropy-rngd
4. /proc/sys/kernel/random/entropy_avail is 3
5. sudo /opt/custom-version/jitterentropy-rngd (the one without the ioctl
line) 6. cpu use is normal
7. /proc/sys/kernel/random/entropy_avail is 378
Thanks a lot for the verification - I will release a patch shortly.
Just to clarify: when you restart the rngd, you *would* get 100% CPU use if
you use the version 1.2.0 rngd. If you remove the ioctl, you have a regular
normal operation, i.e. the CPU use is back to normal.
For the records: the IOCTL copies the added entropy from the input_pool to the
ChaCha20 reducing the input_pool by that amount of entropy. This invokes a new
round of gathering entropy leading to an endless loop.
I have fixed, the code by changing how the IOCTL and the seeding strategy
works such that only a fraction of the data injected into the input_pool are
immediately forwarded to the ChaCha20 DRNG.
Ciao
Stephan
|
Great, thanks! |
Yes, 100% cpu use when starting with the regular rngd, normal cpu with the "patched" version. |
Am Sonntag, 14. März 2021, 17:52:18 CET schrieb eleius:
Hi eleius,
Great, thanks!
Can please you try with the new code?
Ciao
Stephan
|
Cloned and run with latest kernel, still getting 100% cpu use. before killing process:
after killing process:
restarting with -vvv shows:
|
Am Montag, dem 15.03.2021 um 00:54 -0700 schrieb eleius:
Cloned and run with latest kernel, still getting 100% cpu use.
Even when I clear out the entropy pool, I see several injects by the rngd, but
then the system is getting quiet.
Strange - let me get an 5.11.4.
Ciao
Stephan
|
Am Montag, dem 15.03.2021 um 00:54 -0700 schrieb eleius:
Cloned and run with latest kernel, still getting 100% cpu use.
I see the issue and need to think a bit how to best handle it.
Thanks for the test and report.
Ciao
Stephan
|
I've been using 5.11.6 for the latest tests. |
Am Montag, dem 15.03.2021 um 02:04 -0700 schrieb eleius:
> Strange - let me get an 5.11.4. Ciao Stephan
I've been using 5.11.6 for the latest tests.
I hope I have fixed the issue for good now. Can you please test?
Thanks
Stephan
|
Tested, CPU is back to normal. entropy after boot using 1.2.0: 4 So it is fixed :) Thanks! |
Just letting you know that I requested this commit to be taken into Debian testing (soon to be the next stable): P.S. And thanks for the extremly quick fix. Impressive! |
Am Montag, dem 15.03.2021 um 08:55 -0700 schrieb Sebastian Spaeth:
Just letting you know that I requested this commit to be taken into Debian
testing (soon to be the next stable):
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=985302
P.S. And thanks for the extremly quick fix. Impressive!
Thank you.
The issue actually started with the kernel fix
11a0b5e0ec8c13bef06f7414f9e914506140d5cb - Note, I think this fix is
appropriate but affected the behavior of the rngd.
Note, my plan is to integrate the changes to the Jitter RNG library into the
RNGD code in the next days and then release a new version.
Ciao
Stephan
|
I've been using jitterentropy-rngd for a couple of years without issues.
Now, every time I start my laptop (kernel 5.11.6, gnome-shell 3.38.3) I notice the fans are always on (even before reaching the graphical/desktop stage) because the jitterentropy-rngd process is using 100% of the cpu.
If I kill the process the problem goes away, restarting it produces the same high cpu issue.
The text was updated successfully, but these errors were encountered: