开发者

linux kernel idle tick eater (or what will be current task_struct when CPU is 0%)

What process will be pointed by "current" pointer in linux kernel, when CPU load is 0% and there isn't any ready-to-run process?

Consider开发者_开发问答 situation without any power-saving. What is the name of this process? I think task with PID 0 will be running and code will be

rep nop

or

HLT


Current will be pid 0, process swapper or the last process, which called blocking syscall?

http://oreilly.com/catalog/linuxkernel/chapter/ch10.html

Notice that if the runqueue list is empty (no runnable process exists except for swapper), the cycle is not entered and next points to init_task. Moreover, if all processes in the runqueue list have a priority lesser than or equal to the priority of prev, no process switch will take place and the old process will continue to be executed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜