Ubuntu: Why does kworker cpu usage get so high? [duplicate]



Question:

This question already has an answer here:

I recently installed Ubuntu 12.04 on my Samsung laptop alongside Windows 7. Whenever I use Ubuntu (even when its idle) kworker uses almost 90% of one of 8-cores. Even though it doesn't really affect my usage, it bugs me and I am afraid of that it might harm my processor. I even tried installing another Linux distro (Linux Mint), and kworker caused the same problem. So I don't know what to do. I would really appreciate your help.

enter image description here


Solution:1

Instead I think this CPU usage is not normal and is related to the well-known kworker bug: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/887793

The solution for me and for many others was, first of all, find out the "gpe" that is causing the bad stuff with something like:

grep . -r /sys/firmware/acpi/interrupts/  

and check for an high value (mine was gpe13 - with a value like 200K - so, you have to change it accordingly, if differs). After that:

~ cp /sys/firmware/acpi/interrupts/gpe13 /pathtobackup  ~ crontab -e  

Add this line, so it will be executed every startup/reboot:

@reboot echo "disable" > /sys/firmware/acpi/interrupts/gpe13  

Save/exit. Then, to make it work also after wakeup from suspend:

~ touch /etc/pm/sleep.d/30_disable_gpe13  ~ chmod +x /etc/pm/sleep.d/30_disable_gpe13  ~ vim /etc/pm/sleep.d/30_disable_gpe13  

Add this stuff:

#!/bin/bash  case "$1" in      thaw|resume)          echo disable > /sys/firmware/acpi/interrupts/gpe13 2>/dev/null          ;;      *)          ;;  esac  exit $?  

Save/exit, done.

Tested and working on :

Ubuntu 12.10 on Samsung Chronos 7 series - Model no. NP700Z7C --  Ubuntu 16.04.2 on Clevo - Model no. P650RS --  


Solution:2

The CPU usage seems to be normal, there's only 1 CPU (CPU1) that has high usage. In all there are total 3 process that are in the running state two of them being kworker and gnome-system-mo (the first 2 processes in the top command screen short you added).

"kworker" is a placeholder process for kernel worker threads, which perform most of the actual processing for the kernel, especially in cases where there are interrupts, timers, I/O, etc. These typically correspond to the vast majority of any allocated "system" time to running processes. It is not something that can be safely removed from the system in any way, and is completely unrelated to nepomuk or KDE (except in that these programs may make system calls, which may require the kernel to do something)

For more information about kworker please have look at the following link:- What's KWorker and it's importance


Solution:3

I installed Linux Mint 17 yesterday and noticed this evening that kworker was consuming 100% of one of 4 cpus. I ran the above check, but did not find anything other than 0 for the interrupts.

While examining the services that I normally have running, I noticed that shutting down the nfs server dropped the kworker thread back to zilch. A restart of the nfs server did not fix the issue.

I found this bug report (https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1322407), which indicates that a similar nfs server problem was fixed in kernel 3.13.0-32.57. The latest update on Mint 17 appears to be running kernel 3.13.0-24-generic, so I don't have the fix in the kernel that I am running. I don't know if this will help anyone else but I systematically went to each nfs client machine and did a 'umount -a -t nfs' and waited to see if it had any effect. I found the client that seemed to have been causing the issue as the kworker dropped to nothing after I unmounted. I remounted the nfs shares on the client 'mount -a -t nfs' and the problem did not return.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »