Linux Kernel: Targeted Latency vs Minimum Granularity

3.9k Views Asked by At

In context of CFS Scheduler of Linux Kernel what are the most important differences between Targeted Latency and Minimum Granularity.

Or how do we define Targeted Latency and Minimum Granularity.

  • Mathematical explanation is highly appreciated.
1

There are 1 best solutions below

1
On

how do we define Targeted Latency and Minimum Granularity.

From "Linux kernel development" by Robert Love:

1)

CFS sets a target for its approximation of the “infinitely small” scheduling duration in perfect multitasking. This target is called the targeted latency.

2)

Note as the number of runnable tasks approaches infinity, the proportion of allotted processor and the assigned timeslice approaches zero. As this will eventually result in unacceptable switching costs, CFS imposes a floor on the timeslice assigned to each process.This floor is called the minimum granularity.

So, targeted latency is the period in which all run queue tasks are scheduled at least once. And the minimum granularity is the minimum time a task will be be allowed to run on CPU before being pre-empted out.

References: