Re: [PATCH 1/3] sched/core: Avoid requeueing a singleton balance callback
From: Tejun Heo
Date: Tue Oct 20 2026 - 13:57:46 EST
On Tue, Oct 20, 2026 at 10:43:19AM +0200, Andrea Righi wrote:
> With proxy execution, __schedule() can call set_next_task_scx() with
> SNT_REPICK and then SNT_PICK for the same donor. Both calls queue the
> kick_sync balance callback while kick_sync_pending remains set.
>
> When the callback is the only list entry, its next pointer is NULL, so
> the existing duplicate check misses it. Queueing it again links it to
> itself and causes the wait to run twice.
>
> Also check whether the callback is already the head of the list to
> reject the second insertion.
>
> Fixes: e2859566ffbc ("sched_ext: Queue the kick_sync wait from set_next_task_scx()")
> Reported-by: Tejun Heo <tj@xxxxxxxxxx>
> Link: https://lore.kernel.org/r/08cac02c604dd73ef96fc92eb29d692b@xxxxxxxxxx
> Signed-off-by: Andrea Righi <arighi@xxxxxxxxxx>
Can you resend this to Peter? Please feel free to add
Acked-by: Tejun Heo <tj@xxxxxxxxxx>
Thanks.
--
tejun