The Completely Fair Scheduler executes the task that has so far received the least share of CPU time and is thus the most 'disadvantaged'. So if a task sleeps for a really long time, say 3hrs, how does CFS prevent this task from being executed for the next like 3hrs (to adapt its CPU share to the much larger values of the other tasks)?

Or does CFS do so at all? Or did I get something wrong?

Thanks in advance :)


Just found it out by myself:

each time CFS places a new/old task into the rbtree it does not reuse its old runtime but rather assigns a new one: se->vruntime = max(se->vruntime, vruntime) where vruntime is the current minimum virtual runtime.

That is basically what is expressed through "sleeper fairness": each task gets a fair share of CPU time, no matter whether it is running or not.

| cite | improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.