4

Adding to this question, how does the scheduler determine if a process is I/O bound or CPU bound?

Mr. Love in this article, says

"schedulers often employ complex algorithms to determine the most worthwhile process to run"

What are these complex algorithms?

  • Try searching on lwn.net, it often has good articles about the internals of the Linux kernel. – Gilles Jan 12 '16 at 21:56
0

A CPU bound process is more likely to be preempted by the scheduler after having used all of its CPU time slice while an I/O bound process is more likely to release its CPU time slice early by performing I/Os. The scheduler being involved in the preemption has all the metrics to sort out the processes.

0

If you want to know the specifics, then the source code is the place to go.

As a general principle, a compute-bound process will use its entire time-slice more often than an I/O-bound process. Processes that have recently yielded without using their entire allocation are considered more likely to do the same in the near future, and can be scheduled accordingly.

It's important to remember that processes can and do change behaviour as they run; how long to decay the memory of past time-slices is one of the important tunables of most schedulers.

Real schedulers have to take into account more than just the historical time-slice usage: 'nice' value and locks that block other processes are just two examples of other information that may be used.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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