Re: [PATCH 26/30] sched: handle preempt=voluntary under PREEMPT_AUTO

From: Joel Fernandes
Date: Sat Mar 02 2024 - 20:08:33 EST


Hi Anukr,

On Mon, Feb 12, 2024 at 09:55:50PM -0800, Ankur Arora wrote:
> The default preemption policy for voluntary preemption under
> PREEMPT_AUTO is to schedule eagerly for tasks of higher scheduling
> class, and lazily for well-behaved, non-idle tasks.
>
> This is the same policy as preempt=none, with an eager handling of
> higher priority scheduling classes.

AFAICS, the meaning of the word 'voluntary' has changed versus the old
CONFIG_PREEMPT_VOLUNTARY, with this patch.

So the word voluntary does not completely make sense in this context. What is
VOLUNTARY about choosing a higher scheduling class?

For instance, even in the same scheduling class, there is a notion of higher
priority, not just between classes. Example, higher RT priority within RT, or
earlier deadline within EEVDF (formerly CFS).

IMO, just kill 'voluntary' if PREEMPT_AUTO is enabled. There is no
'voluntary' business because
1. The behavior vs =none is to allow higher scheduling class to preempt, it
is not about the old voluntary.
2. you are also planning to remove cond_resched()s via this series and leave
it to the scheduler right?

Or call it preempt=higher, or something? No one is going to understand the
meaning of voluntary the way it is implied here IMHO.

thanks,

- Joel