[armhf][Nokia-7215]High CPU caused by entropy.py (#13694)
Why I did it High CPU utilization by entropy.py How I did it Remove entropy script as it does not work anymore and is no longer needed for bullseye(202205). In Buster(202012) the max available poolsize (entropy_avail) for entropy is 4096 and our entropy.py script was based on this value. With the change in kernel to bullseye on 202205 this entropy poolsize was changed to 256 which also causes our script to fail. This script was initially added to provide SW assistance to improve the system entropy value available early on in the Sonic boot sequence on buster. On bullseye (Linux kernel 5.10) this is no longer needed as this feature has been improved. How to verify it run "top" command to check CPU usage.
This commit is contained in:
parent
94e59a841e
commit
979e9a7d9d
@ -2,5 +2,4 @@ nokia-7215_plt_setup.sh usr/sbin
|
||||
7215/scripts/nokia-7215init.sh usr/local/bin
|
||||
7215/service/nokia-7215init.service etc/systemd/system
|
||||
7215/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/armhf-nokia_ixs7215_52x-r0
|
||||
entropy.py etc/
|
||||
inband_mgmt.sh etc/
|
||||
|
@ -1,22 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
import fcntl, struct
|
||||
import time
|
||||
from os import path
|
||||
|
||||
RNDADDENTROPY=0x40085203
|
||||
|
||||
def avail():
|
||||
if path.exists("/proc/sys/kernel/random/entropy_avail"):
|
||||
with open("/proc/sys/kernel/random/entropy_avail", mode='r') as avail:
|
||||
return int(avail.read())
|
||||
else:
|
||||
return int(2048)
|
||||
|
||||
if path.exists("/proc/sys/kernel/random/entropy_avail"):
|
||||
while 1:
|
||||
while avail() < 2048:
|
||||
with open('/dev/urandom', 'rb') as urnd, open("/dev/random", mode='wb') as rnd:
|
||||
d = urnd.read(512)
|
||||
t = struct.pack('ii', 4 * len(d), len(d)) + d
|
||||
fcntl.ioctl(rnd, RNDADDENTROPY, t)
|
||||
time.sleep(30)
|
@ -25,7 +25,6 @@ main()
|
||||
fw_uboot_env_cfg
|
||||
echo "Nokia-IXS7215: /dev/mtd0 FW_ENV_DEFAULT"
|
||||
|
||||
python /etc/entropy.py &
|
||||
/bin/sh /etc/inband_mgmt.sh
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user