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.
精彩评论