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

This question already has an answer here:

I.e. is it the O(1) scheduler, the CFS scheduler, or an older one?

share|improve this question

marked as duplicate by goldilocks, terdon, slm, Ramesh, Braiam Apr 29 '14 at 15:30

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Which OS are you asking about? – Karlson Apr 17 '12 at 14:42
I assume you're talking about Linux? I don't think there's any other unix variant with these scheduler names. – Gilles Apr 17 '12 at 23:39
It's a linux variant: RHEL – daveb Apr 18 '12 at 10:55

You can call sched_getscheduler(process_pid) to determine the scheduling policy for a process.

If /sys/kernel/uids exists, you have CFS. Or you could try

[[ -n $(awk '$3 == "load_balance_fair" {print;}' < /proc/kallsyms) ]] && 
  echo CFS

I'm not sure how you could distinguish the O(1) scheduler from other obsolete schedulers. You could use the kernel version I suppose, but since distributions applied patches to their shipped kernels, this will be unreliable.

share|improve this answer
That's what I thought at first, but it looks like the return value from sched_getscheduler doesn't tell you which process scheduler is being used, just what scheduling policy is being used for the current process (essentially: normal/batch/realtime/low priority). – Mikel Apr 17 '12 at 15:27
Yes. That's why the second and following sentences of my answer are there! – James Youngman Apr 18 '12 at 8:38

The scheduler of a process can be defined by the programmer, using this funcion man sched_setscheduler

to see the scheduler uses by a process you can use the top command

for change the scheduler of a procces chrt

share|improve this answer

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