Question

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
Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top