Re: [PATCH 3/6] sched_ext: Replace SCX_RQ_BAL_KEEP with a dispatch verdict return

From: Andrea Righi

Date: Tue Aug 11 2026 - 03:43:58 EST


Hi Tejun,

On Fri, Aug 07, 2026 at 11:02:18AM -1000, Tejun Heo wrote:
> SCX_RQ_BAL_KEEP tells the pick to keep running the previous task, a leftover
> from when balancing and picking were separate operations. An rq-level flag
> only works while dispatches and picks pair up one to one, which core
> scheduling breaks: selections interleave through dispatch's lock drops and a
> pick can consume a stale flag, keeping a task that has since been dequeued.
> Fixing core scheduling support requires the decision to travel with the
> dispatch that made it. Make scx_dispatch_sched() and balance_one() return an
> explicit verdict instead.
>
> Also factor the pick-side invocation, its follow-up queueing and the
> post-dispatch checks out of do_pick_task_scx() into dispatch_pick(). No
> functional changes intended.
>
> Fixes: 4c95380701f5 ("sched/ext: Fold balance_scx() into pick_task_scx()")
> Cc: stable@xxxxxxxxxxxxxxx # v6.19+
> Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
> ---

...

> diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
> index 450b6a04669f..14c2df6fd9af 100644
> --- a/kernel/sched/sched.h
> +++ b/kernel/sched/sched.h
> @@ -784,7 +784,6 @@ enum scx_rq_flags {
> */
> SCX_RQ_ONLINE = 1 << 0,
> SCX_RQ_CAN_STOP_TICK = 1 << 1,
> - SCX_RQ_BAL_KEEP = 1 << 3, /* balance decided to keep current */
> SCX_RQ_CLK_VALID = 1 << 5, /* RQ clock is fresh and valid */
> SCX_RQ_BAL_CB_PENDING = 1 << 6, /* must queue a cb after dispatching */

Should we update also tools/sched_ext/include/scx/*.h to remove SCX_RQ_BAL_KEEP?

Thanks,
-Andrea