smuellerDD / lrng

Linux Random Number Generator
http://www.chronox.de/lrng
68 stars 11 forks source link

hwrng process maxed out cpu usage #21

Closed xeome closed 1 year ago

xeome commented 1 year ago

hwrng never stops using one core at 100% all the time. No issues with vanilla arch kernel, 6.1 testing. Ryzen 5 5500u CPU

I use CachyOS kernels (which have this lrng patch), specifically linux-cachyos-bore; I don't believe this was happening prior to 6.1. I no longer have high CPU usage after removing lrng patchset and recompiling (thanks @ptr1337).

It begins at 30% and gradually increases to 100%, never decreases. image

image

I do not see any error messages on dmesg or journalctl.

smuellerDD commented 1 year ago

Am Montag, 12. Dezember 2022, 22:16:39 CET schrieb Emin:

Hi Emin,

hwrng never stops using one core at 100% all the time. No issues with vanilla arch kernel, 6.1 testing. Ryzen 5 5500u CPU

I use CachyOS kernels (which have this lrng patch), specifically linux-cachyos-bore; I don't believe this was happening prior to 6.1. I no longer have high CPU usage after removing lrng patchset and recompiling (thanks @ptr1337).

It begins at 30% and gradually increases to 100%, never decreases. image

image

I do not see any error messages on dmesg or journalctl.

Thanks for the note.

I have the LRNG running on 6.1 but without the issues you see.

Would you be able to compile the kernel with the LRNG patch, and the dynamic printk enabled? Once done, boot with the following command line option:

"dyndbg=file drivers/char/lrng/* +p"

The dmesg output will now contain the operational details of the LRNG.

Could you send me the dmesg output? You can limit it with dmesg | grep lrng.

Thanks Stephan

xeome commented 1 year ago

Sorry for late reply, I couldn't test the printk thing because I was busy.
https://github.com/smuellerDD/lrng/commit/b363c19529ff0b0b0b7d20c8ebd38f656318c8bb This commit seems to fix the cpu usage problem, I'm no longer having excessive cpu usage with hwrng. Thanks @ptr1337 again for compiling me kernel with updated lrng patch.

smuellerDD commented 1 year ago

Am Freitag, 23. Dezember 2022, 19:42:02 CET schrieb Emin:

Hi Emin,

Sorry for late reply, I couldn't test the printk thing because I was busy. https://github.com/smuellerDD/lrng/commit/b363c19529ff0b0b0b7d20c8ebd38f6563 18c8bb This commit seems to fix the cpu usage problem, I'm no longer having excessive cpu usage with hwrng. Thanks @ptr1337 again for compiling me kernel with updated lrng patch.

Thank you very much for the test and the report. The actual fix is the following one-liner:

https://github.com/smuellerDD/lrng/commit/ e9c3511e798c570c16c97be09cd2a57e39f28928

With that, I can tag the release of the LRNG for 6.1 and prepare the backports.

Ciao Stephan

smuellerDD commented 1 year ago

Issue closed