Re:What's a CPU to do when it has nothing to do?
by sedatk on Thursday October 11, 2018 @03:22AM
(#18191527)
Windows also has a similar thread called “Zero Page Thread” which has the lowest priority on the system (even lower than IDLE, IIRC).
[ Parent
| on HN ]
Re:What's a CPU to do when it has nothing to do?
by ovi256 on Thursday October 11, 2018 @03:56AM
(#18191669)
>lower than IDLE
Any idea why that's necessary ? So it's preempted by a IDLE process.
Re:What's a CPU to do when it has nothing to do?
by JdeBP on Thursday October 11, 2018 @06:58AM
(#18192403)
Windows NT thread scheduling does not work that way. If the Zero Page Thread is ready to run, the processor's Idle Thread is not scheduled. Idle Threads do not live on ready queues, and are only dispatched when there is no thread available from the processor's ready queue.
Also, do not conflate the user-thread idle priority class with the (non-)priorities of Idle Threads.
Re:What's a CPU to do when it has nothing to do?
by bonzini on Thursday October 11, 2018 @04:25AM
(#18191773)
IDLE is the priority of a process that runs only when the system is otherwise idle. It shouldn't be preempted by zeroing memory.
Re:What's a CPU to do when it has nothing to do?
by na412 on Thursday October 11, 2018 @05:10AM
(#18191962)
But then under what circumstances will the zero page thread ever be scheduled?
Re:What's a CPU to do when it has nothing to do?
by masklinn on Thursday October 11, 2018 @09:53AM
(#18193520)
It's confusing, but "idle" is a priority class as well as a state: https://docs.microsoft.com/en-us/windows/desktop/procthread/...
The idle task (when there's nothing to run) doesn't have a priority at all, it just gets run when nothing else is available. the "idle" priority is an actual priority, for when there's no higher-priority task to run. The ZPT is prioritized below "idle", so super-duper-low priority.
Re:What's a CPU to do when it has nothing to do?
by dTal on Friday October 12, 2018 @05:09AM
(#18200214)
Thank you for this clear explanation. It is confusing!
Re:What's a CPU to do when it has nothing to do?
by blattimwind on Thursday October 11, 2018 @07:07AM
(#18192444)
When there are no runnable idle threads.
Re:What's a CPU to do when it has nothing to do?
by chaosite on Thursday October 11, 2018 @05:14AM
(#18191969)
So the zero page process runs when one core is busy but the rest are free?
Re:What's a CPU to do when it has nothing to do?
by klodolph on Thursday October 11, 2018 @09:29AM
(#18193337)
It runs when the there are no higher-priority processes to schedule on a particular core. IDLE processes are higher priority, so as long as an IDLE process can be scheduled, the zero page process won't run.