kworker processes consume CPU using kernel 5.10.x and wifi
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- c, linux, raspberry-pi
- Domain
- networking, operating-systems
Research direction
Start by reproducing the report on a Raspberry Pi with kernel 5.10.x, using Wi-Fi and toggling eth0 with /sbin/ifconfig eth0 up and down while monitoring kworker in top. Compare the behavior with kernel 5.4.83 and collect the relevant uname, CPU, and firmware details; done means Wi-Fi no longer causes persistent kworker CPU usage without taking eth0 down.
Written by the indexing model from the issue text.
Description
Is this the right place for my bug report?
Presumably, because kworker is kernel related.
Describe the bug
In short words: The kworker processes consume to much CPU with newer kernels 5.10.x using wifi
After updating my Raspberry PI 1B and 3B from kernel 5.4.83 to the newer kernel 5.10.x the kworker processes continuously consumes more than 1,5% CPU (on Raspberry 3b) and more than 3% CPU on Raspberry 1B and load does not go to 0 anymore although the system has nothing to do (should be idle).
I found out that the problems occures only while using wlan (wifi). When using lan with eth0 the load goes down to 0.00 again.
I found a workaround for using the wlan and beeing not connected to the lan. When I take down eth0 with
/sbin/ifconfig eth0 down
then the kworker process calms down and the load goes to zero again.
To easily reproduce the problem I can bring eth0 up with
/sbin/ifconfig eth0 up
Then the kworker starts consuming CPU again. My Raspberry 1b shows e.g.
top - 10:48:30 up 12 days, 13:39, 1 user, load average: 0.73, 0.34, 0.19
Tasks: 76 total, 1 running, 75 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.7 us, 3.4 sy, 0.0 ni, 95.2 id, 0.0 wa, 0.0 hi, 0.7 si, 0.0 st
MiB Mem : 477.6 total, 146.7 free, 86.8 used, 244.1 buff/cache
MiB Swap: 100.0 total, 100.0 free, 0.0 used. 317.5 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
7829 root 20 0 0 0 0 D 3.9 0.0 0:04.90 kworker/0:2+events_power_efficient
7831 roland 20 0 10188 3008 2524 R 1.6 0.6 0:00.16 top
6905 root 20 0 0 0 0 I 0.3 0.0 0:14.43 kworker/u2:2-phy0
7813 roland 20 0 12188 4188 3392 S 0.3 0.9 0:00.18 sshd
7830 root 20 0 0 0 0 I 0.3 0.0 0:00.04 kworker/0:4-events
1 root 20 0 33700 8072 6420 S 0.0 1.7 1:38.99 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.84 kthreadd
Then after taking eth0 down the kworker process does not consume CPU
/sbin/ifconfig eth0 down
=> afterwards top shows e.g.:
top - 10:52:46 up 12 days, 13:43, 1 user, load average: 0.17, 0.24, 0.18
Tasks: 75 total, 1 running, 74 sleeping, 0 stopped, 0 zombie
%Cpu(s): 1.0/1.3 2[|| ]
MiB Mem : 477.6 total, 146.6 free, 86.9 used, 244.2 buff/cache
MiB Swap: 100.0 total, 100.0 free, 0.0 used. 317.4 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
476 mysql 20 0 718184 66124 15108 S 0.0 13.5 50:46.06 mysqld
9 root 20 0 0 0 0 S 0.0 0.0 4:30.50 ksoftirqd/0
477 root 20 0 211308 23776 19128 S 0.0 4.9 3:15.12 apache2
18 root 20 0 0 0 0 S 0.0 0.0 2:11.88 kcompactd0
1 root 20 0 33700 8072 6420 S 0.0 1.7 1:38.99 systemd
97 root 20 0 35512 8452 7600 S 0.0 1.7 0:46.70 systemd-journal
To reproduce you can switch on and of the kworker CPU consumption with
/sbin/ifconfig eth0 up
and
/sbin/ifconfig eth0 down
Actual behaviour
After booting the raspberry PIs using Wifi the kworker processes always consumes CPU.
Expected behaviour
It would be great if the kworker processes are calm without the need to call "/sbin/ifconfig eth0 down"
System
My systems are a Raspberry PI 1B and a Raspberry Pi 3B (32 and 64 Bit Raspbian) with kernel from 5.10.x. The older 5.4 kernel did not have this problem.
Here an example from the Raspberry PI 1B:
cat /etc/rpi-issue
Raspberry Pi reference 2019-09-26
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 80d486687ea77d31fc3fc13cf3a2f8b464e129be, stage2
uname -a
Linux antares 5.10.63+ #1488 Thu Nov 18 16:14:04 GMT 2021 armv6l GNU/Linux
Firmware version (vcgencmd version)
Dec 1 2021 15:07:23
Copyright (c) 2012 Broadcom
version 71bd3109023a0c8575585ba87cbb374d2eeb038f (clean) (release) (start_cd)
CPU:
/proc/cpuinfo
=>
processor : 0
model name : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS : 697.95
Features : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xb76
CPU revision : 7
Hardware : BCM2835
Revision : 100000e
Serial : 00000000894b0b9f
Model : Raspberry Pi Model B Rev 2
Now Raspberry PI 3b e.g. in 64 Bit mode:
cat /etc/rpi-issue
Raspberry Pi reference 2021-10-30
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, c12b1df4ed6416fb0df33ba1731c5b13c1bdbdf8, stage2
kernel:
uname -a
Linux wega 5.10.63-v8+ #1488 SMP PREEMPT Thu Nov 18 16:16:16 GMT 2021 aarch64 GNU/Linux
firmware:
Nov 18 2021 16:18:09
Copyright (c) 2012 Broadcom
version d9b293558b4cef6aabedcc53c178e7604de90788 (clean) (release) (start)
CPU:
$ lscpu
Architecture: aarch64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
Vendor ID: ARM
Model: 4
Model name: Cortex-A53
Stepping: r0p4
CPU max MHz: 1200.0000
CPU min MHz: 600.0000
BogoMIPS: 38.40
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Spec store bypass: Not affected
Vulnerability Spectre v1: Mitigation; __user pointer sanitization
Vulnerability Spectre v2: Not affected
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected
Flags: fp asimd evtstrm crc32 cpuid
$ cat /proc/cpuinfo
processor : 0
BogoMIPS : 38.40
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 1
BogoMIPS : 38.40
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 2
BogoMIPS : 38.40
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 3
BogoMIPS : 38.40
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
Hardware : BCM2835
Revision : a02082
Serial : 00000000c79dc44c
Model : Raspberry Pi 3 Model B Rev 1.2
I can bring more details form the Raspberry 3B, too (e.g. in 32 Bit mode) but I assume that all versions of Raspberry 1 to at least 3B are affected. At least I observe this problems with 32 Bit and 64 Bit kernels with all kernel versions from 5.10 to the latest version 5.10.63
I already opened an issue on https://forums.raspberrypi.com/viewtopic.php?p=1902788#p1902788
It would be great if you can help and fix this problem.
Kind regards,
Roland
- Dominant language
- C
- Stars
- 13.2k
- Forks
- 5.5k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 21
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from raspberrypi/linux
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/linux#7415 · 2 comments · 1 reaction ·
-
rp1-cfe doesn't forward V4L2_EVENT_SOURCE_CHANGE event from csi-2 sensor driver to userspace app Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
raspberrypi/linux#7399 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
raspberrypi/linux#7357 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/linux#7054 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
raspberrypi/linux#7634 · 8 comments · 1 reaction ·
All issues in raspberrypi/linux
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
zephyrproject-rtos/zephyr#119726 ·
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
BasedHardware/omi#15320 ·
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarbourMasters/Shipwright#7229 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 comment ·