Re: [PATCH 1/6] sched_ext: Simplify scx_can_stop_tick() invocation in sched_can_stop_tick()

David Vernet
2024-08-05T17:56:00Z

[-- Attachment #1: Type: text/plain, Size: 987 bytes --]

On Sat, Aug 03, 2024 at 04:40:08PM -1000, Tejun Heo wrote:
> The way sched_can_stop_tick() used scx_can_stop_tick() was rather confusing
> and the behavior wasn't ideal when SCX is enabled in partial mode. Simplify
> it so that:
>
> - scx_can_stop_tick() can say no if scx_enabled().
>
> - CFS tests rq->cfs.nr_running > 1 instead of rq->nr_running.
>
> This is easier to follow and leads to the correct answer whether SCX is
> disabled, enabled in partial mode or all tasks are switched to SCX.
>
> Peter, note that this is a bit different from your suggestion where
> sched_can_stop_tick() unconditionally returns scx_can_stop_tick() iff
> scx_switched_all(). The problem is that in partial mode, tick can be stopped
> when there is only one SCX task even if the BPF scheduler didn't ask and
> isn't ready for it.
>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Suggested-by: Peter Zijlstra <peterz@infradead.org>

Acked-by: David Vernet <void@manifault.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]