Reputation: 623
Which Scheduling Mechanism is used with Linux Kernel (3.0+) by default, I guess Premptive Scheduling ?
Can we select some other mechanism like Deadline First or Round Robin while building (from the menuconfig) ?
And In Round-Robin Mechanism, how time slice is allocated and used in Kernel ? (I mean Is the time slice calculated on run-time ?)
Upvotes: 1
Views: 2309
Reputation: 40869
Linux is currently using the CFS (Completely Fair Scheduler) scheduler. You can read about it in the kernel documentation. It also contains a real-time scheduler which is disabled by default.
For a very short summary, CFS maintains a time-ordered red-black tree, where all runnable tasks are sorted by the amount of work the CPU has already performed (accounting for wrap-arounds). CFS picks the task with the least amount of work done and "sticks to it". More details are available in the documentation.
Upvotes: 5