From: "Naik, Avadhut" <avadnaik@amd.com>
To: Carlos Bilbao <carlos.bilbao.osdev@gmail.com>,
corbet@lwn.net, sergio.collado@gmail.com, peterz@infradead.org,
rdunlap@infradead.org
Cc: bilbao@vt.edu, jembid@ucm.es, linux-kernel@vger.kernel.org,
linux-doc@vger.kernel.org
Subject: Re: [PATCH v2 1/1] docs: scheduler: Start documenting the EEVDF scheduler
Date: Mon, 15 Jul 2024 00:15:29 -0500 [thread overview]
Message-ID: <5e9be210-0182-45d5-b62f-55c335806455@amd.com> (raw)
In-Reply-To: <20240713140455.4072847-2-carlos.bilbao.osdev@gmail.com>
On 7/13/2024 09:04, Carlos Bilbao wrote:
> Add some documentation regarding the newly introduced scheduler EEVDF.
>
> Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
> Tested-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Carlos Bilbao <carlos.bilbao.osdev@gmail.com>
> ---
> Documentation/scheduler/index.rst | 1 +
> Documentation/scheduler/sched-design-CFS.rst | 10 +++--
> Documentation/scheduler/sched-eevdf.rst | 44 ++++++++++++++++++++
> 3 files changed, 51 insertions(+), 4 deletions(-)
> create mode 100644 Documentation/scheduler/sched-eevdf.rst
>
> diff --git a/Documentation/scheduler/index.rst b/Documentation/scheduler/index.rst
> index 43bd8a145b7a..1f2942c4d14b 100644
> --- a/Documentation/scheduler/index.rst
> +++ b/Documentation/scheduler/index.rst
> @@ -12,6 +12,7 @@ Scheduler
> sched-bwc
> sched-deadline
> sched-design-CFS
> + sched-eevdf
> sched-domains
> sched-capacity
> sched-energy
> diff --git a/Documentation/scheduler/sched-design-CFS.rst b/Documentation/scheduler/sched-design-CFS.rst
> index bc1e507269c6..b703c6dcb3cd 100644
> --- a/Documentation/scheduler/sched-design-CFS.rst
> +++ b/Documentation/scheduler/sched-design-CFS.rst
> @@ -8,10 +8,12 @@ CFS Scheduler
> 1. OVERVIEW
> ============
>
> -CFS stands for "Completely Fair Scheduler," and is the new "desktop" process
> -scheduler implemented by Ingo Molnar and merged in Linux 2.6.23. It is the
> -replacement for the previous vanilla scheduler's SCHED_OTHER interactivity
> -code.
> +CFS stands for "Completely Fair Scheduler," and is the "desktop" process
> +scheduler implemented by Ingo Molnar and merged in Linux 2.6.23. When
> +originally merged, it was the replacement for the previous vanilla
> +scheduler's SCHED_OTHER interactivity code. Nowadays, CFS is making room
> +for EEVDF, for which documentation can be found in
> +:ref:`sched_design_EEVDF`.
>
> 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
> new file mode 100644
> index 000000000000..019327da333a
> --- /dev/null
> +++ b/Documentation/scheduler/sched-eevdf.rst
> @@ -0,0 +1,44 @@
> +.. _sched_design_EEVDF:
> +
> +===============
> +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
> +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 :ref:`sched_design_CFS`.
> +
> +Similarly to CFS, EEVDF aims to distribute CPU time equally among all
> +runnable tasks with the same priority. To do so, it assigns a virtual run
> +time to each task, creating a "lag" value that can be used to determine
> +whether a task has received its fair share of CPU time. In this way, a task
> +with a positive lag is owed CPU time, while a negative lag means the task
> +has exceeded its portion. EEVDF picks tasks with lag greater or equal to
> +zero and calculates a virtual deadline (VD) for each, selecting the task
> +with the earliest VD to execute next. It's important to note that this
> +allows latency-sensitive tasks with shorter time slices to be prioritized,
> +which helps with their responsiveness.
> +
> +There are ongoing discussions on how to manage lag, especially for sleeping
> +tasks; but at the time of writing EEVDF uses a "decaying" mechanism based
> +on virtual run time (VRT). This prevents tasks from exploiting the system
> +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.
> +
> +REFERENCES
> +==========
> +
> +[1] https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&doi=805acf7726282721504c8f00575d91ebfd750564
> +
> +[2] https://lore.kernel.org/lkml/a79014e6-ea83-b316-1e12-2ae056bda6fa@linux.vnet.ibm.com/
> +
> +[3] https://lwn.net/Articles/969062/
> +
> +[4] https://lwn.net/Articles/925371/
LGTM.
Reviewed-by: Avadhut Naik <avadhut.naik@amd.com>
--
Thanks,
Avadhut Naik
next prev parent reply other threads:[~2024-07-15 5:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-13 14:04 [PATCH v2 0/1] " Carlos Bilbao
2024-07-13 14:04 ` [PATCH v2 1/1] " Carlos Bilbao
2024-07-14 13:40 ` Sergio González Collado
2024-07-15 5:15 ` Naik, Avadhut [this message]
2024-07-16 16:45 ` Jonathan Corbet
2024-07-20 0:07 ` Carlos Bilbao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5e9be210-0182-45d5-b62f-55c335806455@amd.com \
--to=avadnaik@amd.com \
--cc=bilbao@vt.edu \
--cc=carlos.bilbao.osdev@gmail.com \
--cc=corbet@lwn.net \
--cc=jembid@ucm.es \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=rdunlap@infradead.org \
--cc=sergio.collado@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®