Linux – Which Scheduling algorithm is used in Linux

Architecturelinuxrtosscheduling

Recently in an interview I was asked about the Scheduling algorithm used by Linux Operating system. What is the algorithm used any why?

Also, what algorithm is used in in real-time operating systems and why?

Best Answer

The current Linux task scheduler is called Completely Fair Scheduler (CFS). You should have a look at http://people.redhat.com/mingo/cfs-scheduler/sched-design-CFS.txt for more details. The design is quite complex and in my view not suitable for RTOS.

A common technique in realtime systems is rate-monotonic scheduling, because it has strong guarantees if certain assumptions hold (e.g. static task priorities and fixed execution time and rate). There are a whole lot other algorithms and there has been a lot of research. So it's basically all about the properties you need and what you know about your task and what is fixed.

Related Question