Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux kernel scheduling

I wish to know how Old Linux scheduling algorithm SJF (shortest job first) calculates the process runtime ?

like image 617
Arpit Avatar asked Mar 09 '10 05:03

Arpit


People also ask

What is Linux kernel scheduler?

The Completely Fair Scheduler (CFS) is a process scheduler that was merged into the 2.6. 23 (October 2007) release of the Linux kernel and is the default scheduler of the tasks of the SCHED_NORMAL class (i.e., tasks that have no real-time execution constraints).

What is the current Linux scheduler?

Current Linux kernel uses Completely Fair Scheduler(CFS) which does not meet the complete requirements of a good scheduler, since its complexity is O(log n) and its scheduling policy can cause starvation of optimally threaded process in the presence of greedy threaded process.

How does CFS work Linux?

CFS gives every task a fair share of processor resources in a low-fuss but highly efficient way. Linux takes a modular approach to processor scheduling in that different algorithms can be used to schedule different process types. A scheduling class specifies which scheduling policy applies to which type of process.

What are the types of scheduling algorithms used by latest Linux kernel?

Priority based preemptive scheduling algorithm.


1 Answers

This problem actually is one of the major reasons why it is rarely used in common environments, since SJF algorithm requires accurate estimate of the runtime of all processes, which is only given in specialized environments.

In common situations you can only get estimated and inaccurate length of process running time, for example, by recording the length of previous CPU bursts of the same process, and use mathematical approximation methods to calculate how long it will run next time.

like image 154
ZelluX Avatar answered Sep 23 '22 11:09

ZelluX