What are the motivating use-cases for each of Linux's SCHED_* scheduling algorithms?

39 Views Asked by At

I've been reading about Linux's various SCHED_* scheduling algorithms (which can be specified for a given thread/process via a call to sched_setscheduler()), and there is a good amount of information about how they work, but I haven't been able to find much about why each of them was created.

For example there is SCHED_DEADLINE, but it's not very clear under what circumstances it would be appropriate/beneficial to use it rather than one of the other algorithms.

Therefore, my question is: for each of these algorithms, what is a "canonical" example of an application for which that algorithm would be the preferred/most-appropriate one to use? i.e. what specific motivating use-cases did the designers of the algorithm have in mind when they created the algorithm?

For reference, I've listed the algorithms below, along with my current (partial) understanding of what they should be used for.

  • SCHED_OTHER -- for all "normal" (non-time-sensitive) applications that need to share the CPU as fairly as possible, with generally-good response time and no chance of thread-starvation, regardless of how the threads behave. For example, a web browser would use this scheduler.
  • SCHED_FIFO -- for time-sensitive (soft-real-time) applications that need low latency at all times if at all possible, even if it means lower-priority threads might starve in certain scenarios. For example, an audio driver might use this scheduler.
  • SCHED_RR -- ???
  • SCHED_BATCH -- for applications that don't care about timing/latency at all, but just need as many spare cycles as the system can afford when it's not doing anything else. For example, a bitcoin mining program might use this scheduler.
  • SCHED_ISO -- ???
  • SCHED_IDLE -- ???
  • SCHED_DEADLINE -- ???
0

There are 0 best solutions below