Chinaunix首页 | 论坛 | 博客
  • 博客访问: 139643
  • 博文数量: 49
  • 博客积分: 65
  • 博客等级: 民兵
  • 技术积分: 135
  • 用 户 组: 普通用户
  • 注册时间: 2011-10-06 12:26
文章分类
文章存档

2015年(21)

2014年(5)

2012年(20)

2011年(3)

我的朋友

分类: LINUX

2015-01-10 10:24:46

原文地址:why kworker0:1 occupy CPU so high? 作者:tuyer

arch/x86/kernel/smpboot.c
worker_thread()-> process_one_work()-> do_fork_idle()-> fork_idle()-> copy_process()

firstly: there is one idle task for every CPU.

secondely: the idle process is forked by current process, here, it is kwoker0:1, and the name also is copyed, so idel processes and kworker0:1 have the same task name, it is also the reason that the kworker0:1 occupies the CPU so long time(more than 90%) showed by pytimechart tool.

thirdly: we can change the idle process name also in init_idle() by set_task_comm(), note that, we should set the name with CPU id, for example:
sprintf(str, "idle:%d", cpu);
set_task_comm(idle, str);

阅读(1086) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~