rng-tools: disable libjitterentropy due to cpu usage
PATCH 1/1 rng-tools: disable libjitterentropy due to cpu usage
Since updating to kirkstone from hardknott, after boot rngd maxes out my rpi4's processor for minutes initializing JITTER. The sustained CPU usage was triggering my resource monitoring alerts. Changing config to disable jitter with -x jitter stops the initialization process and uses just the pi's hardware rng source. Since that solved the problem I disabled building rng-tools with libjitterentropy enabled.
I submitted the change to meta-raspberrypi (pull #1057) where kraj noted that the CPU spike is seen even on qemu so the change should go in the core layer.
PATCH 1/1 rng-tools: disable libjitterentropy due to cpu usage
After boot rngd maxes out the processor initializing JITTER entropy for some minutes. Here we disable libjitterentropy in favor of only using the hardware random source via config.
--- meta/recipes-support/rng-tools/rng-tools_6.15.bb | 1 - 1 file changed, 1 deletion(-)
meta/recipes-support/rng-tools/rng-tools_6.15.bb +0 -1
@@ -21,7 +21,6 @@ inherit autotools update-rc.d systemd pkgconfig EXTRA_OECONF = "--without-rtlsdr" -PACKAGECONFIG ??= "libjitterentropy" PACKAGECONFIG:libc-musl = "libargp libjitterentropy" PACKAGECONFIG[libargp] = "--with-libargp,--without-libargp,argp-standalone,"
Signature · 1 line
2.36.0
Isn't this desirable if you don't have an hwrng? We want to generate entropy so we can perform cryptographic operations by default if we bring in rng-tools.
Quoted 34 lines · Wes Malone
After boot rngd maxes out the processor initializing JITTER entropy for some minutes. Here we disable libjitterentropy in favor of only using the hardware random source via config.
Signed-off-by Wes Malone <[email protected]>--- meta/recipes-support/rng-tools/rng-tools_6.15.bb | 1 - 1 file changed, 1 deletion(-)meta/recipes-support/rng-tools/rng-tools_6.15.bb +0
-2@@ -21,7 +21,6 @@ inherit autotools update-rc.d systemd pkgconfig EXTRA_OECONF = "--without-rtlsdr" -PACKAGECONFIG ??= "libjitterentropy" PACKAGECONFIG:libc-musl = "libargp libjitterentropy" PACKAGECONFIG[libargp] = "--with-libargp,--without-libargp,argp-standalone," --2.36.0
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#165176): https://lists.openembedded.org/g/openembedded-core/message/165176
Mute This Topic: https://lists.openembedded.org/mt/90845997/4454469
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Yes, I wonder why this needs to be disabled altogether at build time. Can’t rng-tools figure out the right sources at run time?
Alex
Quoted 47 lines · William A. Kennington III via lists.openembedded.org
Isn't this desirable if you don't have an hwrng? We want to generate entropy so we can perform cryptographic operations by default if we bring in rng-tools.
Review
Quoted 11 lines · Wes Malone
After boot rngd maxes out the processor initializing JITTER entropy for some minutes. Here we disable libjitterentropy in favor of only using the hardware random source via config.
Signed-off-by Wes Malone <[email protected]>--- meta/recipes-support/rng-tools/rng-tools_6.15.bb | 1 - 1 file changed, 1 deletion(-)(quoted diff) +0
-0b/meta/recipes-support/rng-tools/rng-tools_6.15.bb
meta/recipes-support/rng-tools/rng-tools_6.15.bb inherit autotools update-rc.d systemd pkgconfig · line 26
Quoted 11 lines
index 0696351903..4eed060960 100644
meta/recipes-support/rng-tools/rng-tools_6.15.bb +0
-1@@ -21,7 +21,6 @@ inherit autotools update-rc.d systemd pkgconfig EXTRA_OECONF = "--without-rtlsdr" -PACKAGECONFIG ??= "libjitterentropy" PACKAGECONFIG:libc-musl = "libargp libjitterentropy" PACKAGECONFIG[libargp] ="--with-libargp,--without-libargp,argp-standalone,"
Quoted 6 lines
--
2.36.0-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#165177):
https://lists.openembedded.org/g/openembedded-core/message/165177
Mute This Topic: https://lists.openembedded.org/mt/90845997/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Quoted 1 line
Isn't this desirable if you don't have an hwrng?
Perhaps what's needed then is a 'hwrng' in MACHINE_FEATURES?
Quoted 1 line
Can’t rng-tools figure out the right sources at run time?
rng-tools enables jitter by default if it's built in, even if hwrng is available. Maybe it's faster to do this on more powerful machines but it's disruptive to run the cpu at max for so long on my pi's.
We could also disable it with the /etc/defaults file with -x jitter.
Quoted 49 lines · Alexander Kanavin
Yes, I wonder why this needs to be disabled altogether at build time. Can’t rng-tools figure out the right sources at run time?
Alex
Quoted 43 lines · William A. Kennington III via lists.openembedded.org
Isn't this desirable if you don't have an hwrng? We want to generate entropy so we can perform cryptographic operations by default if we bring in rng-tools.
Quoted 23 lines · Wes Malone
After boot rngd maxes out the processor initializing JITTER entropy for some minutes. Here we disable libjitterentropy in favor of only using the hardware random source via config.
Signed-off-by Wes Malone <[email protected]>--- meta/recipes-support/rng-tools/rng-tools_6.15.bb | 1 - 1 file changed, 1 deletion(-)meta/recipes-support/rng-tools/rng-tools_6.15.bb +0
-2@@ -21,7 +21,6 @@ inherit autotools update-rc.d systemd pkgconfig EXTRA_OECONF = "--without-rtlsdr" -PACKAGECONFIG ??= "libjitterentropy" PACKAGECONFIG:libc-musl = "libargp libjitterentropy" PACKAGECONFIG[libargp] = "--with-libargp,--without-libargp,argp-standalone," --Quoted 5 lines
2.36.0
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#165177): https://lists.openembedded.org/g/openembedded-core/message/165177
Mute This Topic: https://lists.openembedded.org/mt/90845997/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Quoted 11 lines · Wes Malone
Quoted 2 lines
Isn't this desirable if you don't have an hwrng?
Perhaps what's needed then is a 'hwrng' in
MACHINE_FEATURES?Quoted 1 line
Can’t rng-tools figure out the right sources at run time?
rng-tools enables jitter by default if it's built in, even if hwrng is available. Maybe it's faster to do this on more powerful machines but it's disruptive to run the cpu at max for so long on my pi's.
We could also disable it with the
/etc/defaultsfile with-x jitter.
I wonder if rng-tools is still needed after 5.6+ kernel after this commit [1] Arch Linux wiki says no [2]. We added this as a recommendation to openssh by default [3] [4],
I wonder if we can turn that off by default and perhaps add havaged as dependency if needed.
[5] changed to use /dev/hwrng which seems right change to me. I also wonder if we can tune
the resource requirement for rng-tools with limiting cpu threads and buffers allocated for this.
[1] https://github.com/torvalds/linux/commit/30c08efec8884fb106b8e57094baa51bb4c44e32
[2] https://wiki.archlinux.org/title/Rng-tools
[3] https://git.openembedded.org/openembedded-core/commit/?id=9b01375236e19e3366c58877c4154d7c71632984
[4] https://git.openembedded.org/openembedded-core/commit/?id=fe99349c1bd72b69d22ab0dc52b8825d3157b8e7
[5] https://git.openembedded.org/openembedded-core/commit/?id=f1dc9ac46710814c27cae2d22e79c84a9522993a
Quoted 55 lines
Quoted 43 lines · Alexander Kanavin
Yes, I wonder why this needs to be disabled altogether at build time. Can’t rng-tools figure out the right sources at run time?
Alex
Quoted 37 lines · William A. Kennington III via lists.openembedded.org
Isn't this desirable if you don't have an hwrng? We want to generate entropy so we can perform cryptographic operations by default if we bring in rng-tools.
Quoted 28 lines · Wes Malone
After boot rngd maxes out the processor initializing JITTER entropy for some minutes. Here we disable libjitterentropy in favor of only using the hardware random source via config.
Signed-off-by Wes Malone <[email protected]>--- meta/recipes-support/rng-tools/rng-tools_6.15.bb | 1 - 1 file changed, 1 deletion(-)meta/recipes-support/rng-tools/rng-tools_6.15.bb +0
-2@@ -21,7 +21,6 @@ inherit autotools update-rc.d systemd pkgconfig EXTRA_OECONF = "--without-rtlsdr" -PACKAGECONFIG ??= "libjitterentropy" PACKAGECONFIG:libc-musl = "libargp libjitterentropy" PACKAGECONFIG[libargp] = "--with-libargp,--without-libargp,argp-standalone," --2.36.0
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#165204): https://lists.openembedded.org/g/openembedded-core/message/165204
Mute This Topic: https://lists.openembedded.org/mt/90845997/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
I'm not well versed enough in these details to make a decision but I'd like to help fix it once the decision is made. I of course moved on with a small append on my end but I'd like to help fix this since it affected my project.
Quoted 85 lines · Khem Raj
Quoted 11 lines · Wes Malone
Quoted 2 lines
Isn't this desirable if you don't have an hwrng?
Perhaps what's needed then is a 'hwrng' in
MACHINE_FEATURES?Quoted 1 line
Can’t rng-tools figure out the right sources at run time?
rng-tools enables jitter by default if it's built in, even if hwrng is available. Maybe it's faster to do this on more powerful machines but it's disruptive to run the cpu at max for so long on my pi's.
We could also disable it with the
/etc/defaultsfile with-x jitter.I wonder if rng-tools is still needed after 5.6+ kernel after this commit [1] Arch Linux wiki says no [2]. We added this as a recommendation to openssh by default [3] [4],
I wonder if we can turn that off by default and perhaps add havaged as dependency if needed.
[5] changed to use/dev/hwrngwhich seems right change to me. I also wonder if we can tune
the resource requirement for rng-tools with limiting cpu threads and buffers allocated for this.[1] https://github.com/torvalds/linux/commit/30c08efec8884fb106b8e57094baa51bb4c44e32
[2] https://wiki.archlinux.org/title/Rng-tools
[3] https://git.openembedded.org/openembedded-core/commit/?id=9b01375236e19e3366c58877c4154d7c71632984
[4] https://git.openembedded.org/openembedded-core/commit/?id=fe99349c1bd72b69d22ab0dc52b8825d3157b8e7
[5] https://git.openembedded.org/openembedded-core/commit/?id=f1dc9ac46710814c27cae2d22e79c84a9522993aQuoted 55 lines
Quoted 43 lines · Alexander Kanavin
Yes, I wonder why this needs to be disabled altogether at build time. Can’t rng-tools figure out the right sources at run time?
Alex
Quoted 37 lines · William A. Kennington III via lists.openembedded.org
Isn't this desirable if you don't have an hwrng? We want to generate entropy so we can perform cryptographic operations by default if we bring in rng-tools.
Quoted 28 lines · Wes Malone
After boot rngd maxes out the processor initializing JITTER entropy for some minutes. Here we disable libjitterentropy in favor of only using the hardware random source via config.
Signed-off-by Wes Malone <[email protected]>--- meta/recipes-support/rng-tools/rng-tools_6.15.bb | 1 - 1 file changed, 1 deletion(-)meta/recipes-support/rng-tools/rng-tools_6.15.bb +0
-2@@ -21,7 +21,6 @@ inherit autotools update-rc.d systemd pkgconfig EXTRA_OECONF = "--without-rtlsdr" -PACKAGECONFIG ??= "libjitterentropy" PACKAGECONFIG:libc-musl = "libargp libjitterentropy" PACKAGECONFIG[libargp] = "--with-libargp,--without-libargp,argp-standalone," --2.36.0
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#165204): https://lists.openembedded.org/g/openembedded-core/message/165204
Mute This Topic: https://lists.openembedded.org/mt/90845997/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
one way is to make rng-tools use less resources on embedded devices perhaps limit the number of cores its give and buffer sizes. secondly send a patch to remove openssh dependency on rng-tools perhaps
Quoted 92 lines · Wes Malone
I'm not well versed enough in these details to make a decision but I'd like to help fix it once the decision is made. I of course moved on with a small append on my end but I'd like to help fix this since it affected my project.
Quoted 85 lines · Khem Raj
Quoted 11 lines · Wes Malone
Quoted 2 lines
Isn't this desirable if you don't have an hwrng?
Perhaps what's needed then is a 'hwrng' in
MACHINE_FEATURES?Quoted 1 line
Can’t rng-tools figure out the right sources at run time?
rng-tools enables jitter by default if it's built in, even if hwrng is available. Maybe it's faster to do this on more powerful machines but it's disruptive to run the cpu at max for so long on my pi's.
We could also disable it with the
/etc/defaultsfile with-x jitter.I wonder if rng-tools is still needed after 5.6+ kernel after this commit [1] Arch Linux wiki says no [2]. We added this as a recommendation to openssh by default [3] [4],
I wonder if we can turn that off by default and perhaps add havaged as dependency if needed.
[5] changed to use/dev/hwrngwhich seems right change to me. I also wonder if we can tune
the resource requirement for rng-tools with limiting cpu threads and buffers allocated for this.[1] https://github.com/torvalds/linux/commit/30c08efec8884fb106b8e57094baa51bb4c44e32
[2] https://wiki.archlinux.org/title/Rng-tools
[3] https://git.openembedded.org/openembedded-core/commit/?id=9b01375236e19e3366c58877c4154d7c71632984
[4] https://git.openembedded.org/openembedded-core/commit/?id=fe99349c1bd72b69d22ab0dc52b8825d3157b8e7
[5] https://git.openembedded.org/openembedded-core/commit/?id=f1dc9ac46710814c27cae2d22e79c84a9522993aQuoted 55 lines
Quoted 43 lines · Alexander Kanavin
Yes, I wonder why this needs to be disabled altogether at build time. Can’t rng-tools figure out the right sources at run time?
Alex
Quoted 37 lines · William A. Kennington III via lists.openembedded.org
Isn't this desirable if you don't have an hwrng? We want to generate entropy so we can perform cryptographic operations by default if we bring in rng-tools.
Quoted 28 lines · Wes Malone
After boot rngd maxes out the processor initializing JITTER entropy for some minutes. Here we disable libjitterentropy in favor of only using the hardware random source via config.
Signed-off-by Wes Malone <[email protected]>--- meta/recipes-support/rng-tools/rng-tools_6.15.bb | 1 - 1 file changed, 1 deletion(-)meta/recipes-support/rng-tools/rng-tools_6.15.bb +0
-2@@ -21,7 +21,6 @@ inherit autotools update-rc.d systemd pkgconfig EXTRA_OECONF = "--without-rtlsdr" -PACKAGECONFIG ??= "libjitterentropy" PACKAGECONFIG:libc-musl = "libargp libjitterentropy" PACKAGECONFIG[libargp] = "--with-libargp,--without-libargp,argp-standalone," --2.36.0
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#165204): https://lists.openembedded.org/g/openembedded-core/message/165204
Mute This Topic: https://lists.openembedded.org/mt/90845997/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-