[PATCH] docs/scheduler: fix EEVDF-related inaccuracies in the scheduler docs
Zhan Xusheng <[email protected]>
| Newsgroups | org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
From: Zhan Xusheng <[email protected]> While checking the scheduler documentation against the current code I found a few inaccuracies: - sched-design-CFS.rst still describes the fair class as always running the smallest-vruntime ("leftmost") task and references the rq->cfs.min_vruntime field. Since commit 147f3efaa241 ("sched/fair: Implement an EEVDF-like scheduling policy") in Linux 6.6 the fair class implements EEVDF -- pick_eevdf() selects the eligible task (lag >= 0) with the earliest virtual deadline -- and the runqueue's zero-lag reference is now cfs_rq->zero_vruntime (the min_vruntime field is gone). Add a note that sections 2 and 3 describe the original CFS design and no longer match the code, rather than rewriting the historical text. - sched-eevdf.rst said Linux 6.6 was released in 2024 (it was 2023) and described the per-task slice request as "the new sched_setattr() system call". sched_setattr() has existed since Linux 3.14; the slice is carried in the sched_attr::sched_runtime field. Fix both. No code changes. Signed-off-by: Zhan Xusheng <[email protected]> --- Documentation/scheduler/sched-design-CFS.rst | 10 ++++++++++ Documentation/scheduler/sched-eevdf.rst | 7 ++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Documentation/scheduler/sched-design-CFS.rst b/Documentation/scheduler/sched-design-CFS.rst index 03998f6c8f9c..55163506407b 100644 --- a/Documentation/scheduler/sched-design-CFS.rst +++ b/Documentation/scheduler/sched-design-CFS.rst @@ -15,6 +15,16 @@ scheduler's SCHED_OTHER interactivity code. Nowadays, CFS is making room for EEVDF, for which documentation can be found in Documentation/scheduler/sched-eevdf.rst. +.. note:: + + Since Linux 6.6 the fair scheduling class implements EEVDF rather than + the original CFS algorithm. The task selection and placement described + in sections 2 and 3 below (running the smallest-vruntime / "leftmost" + task, and the ``rq->cfs.min_vruntime`` field) describe the original CFS + design and no longer match the code: EEVDF picks the *eligible* task + with the earliest virtual deadline, and the runqueue's zero-lag + reference is now tracked in ``cfs_rq->zero_vruntime``. + 80% of CFS's design can be summed up in a single sentence: CFS basically models an "ideal, precise multi-tasking CPU" on real hardware. diff --git a/Documentation/scheduler/sched-eevdf.rst b/Documentation/scheduler/sched-eevdf.rst index 83efe7c0a30d..e3d62de004c6 100644 --- a/Documentation/scheduler/sched-eevdf.rst +++ b/Documentation/scheduler/sched-eevdf.rst @@ -4,7 +4,7 @@ EEVDF Scheduler The "Earliest Eligible Virtual Deadline First" (EEVDF) was first introduced in a scientific publication in 1995 [1]. The Linux kernel began -transitioning to EEVDF in version 6.6 (as a new option in 2024), moving +transitioning to EEVDF in version 6.6 (released in 2023), moving away from the earlier Completely Fair Scheduler (CFS) in favor of a version of EEVDF proposed by Peter Zijlstra in 2023 [2-4]. More information regarding CFS can be found in @@ -28,8 +28,9 @@ by sleeping briefly to reset their negative lag: when a task sleeps, it remains on the run queue but marked for "deferred dequeue," allowing its lag to decay over VRT. Hence, long-sleeping tasks eventually have their lag reset. Finally, tasks can preempt others if their VD is earlier, and tasks -can request specific time slices using the new sched_setattr() system call, -which further facilitates the job of latency-sensitive applications. +can request specific time slices via the ``sched_runtime`` field of the +sched_setattr() system call, which further facilitates the job of +latency-sensitive applications. REFERENCES ========== -- 2.43.0