Run Queues
We have used the term run queue frequently in this chapter. Let's take a moment to understand what a run queue is, where it is located, and how it is implemented.
The run queue does not exist as a single structure. It is built by linking together all runnable threads on the system to appropriate queue headers. Which queue header a runnable kthread is linked to depends on its processor affinity, its priority, kt_pri and its scheduling policy stored in kt_schedpolicy (stored in the thread's kthread structure). To enter a processor's run queue, we start with the mp_threadhd structures.
The structures are stored in a number of arrays (dependent on the number of processors and processor sets). Each of the per-processor run queues has 160 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access