Re: [PATCH v2 1/2] sched/doc: add a preemption model overview
From: Sebastian Andrzej Siewior
Date: Wed Sep 23 2026 - 03:36:12 EST
On 2026-09-22 16:31:00 [+0800], Quchaosheng wrote:
> The scheduler documentation describes the individual scheduling classes
> and various tuning knobs, but there is nothing that describes the
> preemption models themselves. The only place where they are documented
> is the kernel-parameters entry for "preempt=", which explains the boot
> time parameter but not the models it selects.
…
> Assisted-by: LLM
> Suggested-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
> Signed-off-by: Quchaosheng <quchaosheng000406@xxxxxxx>
This reads very nice.
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
Once comment bellow.
…
> --- /dev/null
> +++ b/Documentation/scheduler/sched-preemption.rst
> @@ -0,0 +1,84 @@
…
> +separates the models:
> +
> +``none``
> + Code paths with long loops contain explicit ``cond_resched()`` calls,
> + which perform the scheduling.
> +
> +``voluntary``
> + As ``none``, and functions which are known to be able to block gain
> + such a call as well.
I know what you are trying to say but it does not sound obvious that you
refer here to cond_resched(). At least to me.
> +
> +``full``
> + Explicit preemption points are no longer involved. The kernel tracks
> + whether it may be preempted and schedules once the request can be
> + honoured.
…
Sebastian