The schedule() function Very much simplified: If previous process is a SCHED_RR process which has exhausted its time slice: assigns a new time slice to it and puts it at the end of runqueue. Main scheduling loop: Loops through items of runqueue Calculates a `goodness' value for each one of them Remembers the first task with highest goodness value Does a context switch to the chosen task.