Scheduler classes
Let's now go deeper into each scheduling class and understand the operations, policies, and heuristics it engages in managing scheduling operations adeptly and elegantly for its processes. As mentioned earlier, an instance of struct sched_class
must be provided by each scheduling class; let's look at some of the key elements from that structure:
enqueue_task
: Basically adds a new process to the run queuedequeue_task
: When the process is taken off the runqueueyield_task
: When the process wants to relinquish CPU voluntarilypick_next_task
: The corresponding function of the pick_next_task called by schedule(). It picks up the next best runnable task from its class.