您尚未登录。

#1 2011-10-02 16:09:25

ReiFFEXzyx
古悠行者
注册时间: 2011-08-20
帖子: 187

令人头痛的kworker

Kworker, what is it and why is it hogging so much CPU?
http://askubuntu.com/questions/33640/kw ... o-much-cpu

"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).

There were some reports of excessing kworker activity for relatively idle systems starting during 2.6.36 development ( https://lkml.org/lkml/2011/3/29/2 is one example discussion ), and wide reports of confusion and problems with 2.6.38 (although many of these reports include the word "Natty", so I presume these people not to have used any kernel between 2.6.35 (distributed in Ubuntu 10.10) and 2.6.38 (distributed in Ubuntu 11.04).

I've found many reports of something that "fixed" this for one or another user. Most "fixes" seem to be related to updates of the kernel of various sorts. Where the update can be tracked to a specific issue, it seems to often be some driver or kernel service that has been patched to not misbehave: I have the impression that there are a very large number of things in the kernel that can cause a behaviour which is observed as excessive kworker usage.

If you find the system unusable due to excessive kworker activity, I would recommend trying to do fewer things. If you think you're not doing anything, try shutting down long-running services or timers (RSS readers, mail readers, file indexers, activity trackers, etc.). If this doesn't work, try restarting. If your system allows you to enable or disable hardware in a preboot environment, try turning off hardware you aren't using. If it happens on every restart before you do anything, you could try uninstalling things, but at this point you'll want to be running syscall profiling tools to track down specific applications that seem to be causing this overload.

It is to be hoped that your specific system will stop expressing this behaviour with a future kernel upgrade (and many of the most common causes of this have been solved).

P.S.
从2.6.38就碰上这个问题了
当时无论用什么系统(Mandriva、Mageia、Fedora...)
无论执行什么操作(编译安装软件最厉害)
kworker总能耗死1核CPU

换Arch后强点了,现在只占用15-20%,而且过一段时间自动恢复正常
虽然影响不太大了,不过卡起来还是非常恼人的

能引起kworker占用的因素太多了,都不知道该从哪儿下手debug... :em20


[fracting的大作]Wine使用中的一些常见误区
http://forum.ubuntu.org.cn/viewtopic.php?f=121&t=363147
顺便学习一下对待开源软件的正确态度

离线

#2 2011-10-02 22:42:04

cuihao
所在地: USTC, Hefei
注册时间: 2011-08-19
帖子: 1,223
个人网站

Re: 令人头痛的kworker

:em01 kworker 是啥?内核服务?
我这里有10个,但不占资源。


Site: CVHC.CC   Twitter: @cuihaoleo   Org: LUG@USTC
AD:  ~欢迎参与志愿计算~

离线

页脚