How does linux kernel's CFS scheduler schedule开发者_Python百科 all the process within sched_latency_ns time. Is it by traversing though the red black tree or re balancing after every process switch.
Start with the Wikipedia article...
In contrast to the previous O(1) scheduler used in older Linux 2.6 kernels, the CFS scheduler implementation is not based on run queues. Instead, a red-black tree implements a "timeline" of future task execution. Additionally, the scheduler uses nanosecond granularity accounting, the atomic units by which an individual process' share of the CPU was allocated (thus making redundant the previous notion of timeslices). This precise knowledge also means that no specific heuristics are required to determine the interactivity of a process, for example.[2]
here describe CFS in details together with snippet source code.
精彩评论