Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
For process or IO scheduling? Or even something else? – maxschlepzig Sep 5 '11 at 19:50

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.

share|improve this answer

I'm not quite sure, whether you are taking about the I/O scheduling of the Kernel. In case you are not: Ignore this answer.

Wikipedia states, that the CFG (completely Fair Queuing) is default since Kernel 2.6.18.

On my openSUSE (running Kernel 2.6.37) I can switch between the CFG, NOOP and Deadline.

Hope this helps.

share|improve this answer
I'm curious,how can we switch to a different algorithm? Can you shed some light on this? thanks – rsjethani Nov 3 '12 at 9:22
@rsjethani Go to YaST -> System -> Kernel Settings -> 2nd Tab (Kernel Settings) -> Global IO Scheduler. (naming of the options might be different as I've translated from a German GUI) – Torbjörn Dec 18 '12 at 9:36

The Round Robin algorithm is generally used in time sharing environments.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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