O(1) scheduler runqueue

Creator
Creator
Seonglae ChoSeonglae Cho
Created
Created
2023 Oct 24 13:8
Editor
Edited
Edited
2023 Oct 24 14:22
Refs
Refs

Runqueue

  • Each CPU has a runqueue made up of 140 priority lists
notion image
 
 

Implementation

notion image
  • Two runqueues for CPU is active and expired for find active
  • expired is queue for waiting re-assignment of time slice
The switch between active and expired queue list can thus only happen when no real-time tasks are in the TASK_RUNNING state
 
 
 
 

SCHED_NORMAL

  • Processes that have consumed their time slice become expired
  • Eventually every active process manages to get the CPU
  • For the SCHED_NORMAL class the Linux scheduler figures out whether a process is I/O-bound or CPU-bound.
    • The kernel keeps track on how much time a process sleeps vs. how much time a process runs.
 
 
 
 
 
 
 

Recommendations