Re: [RFC][PATCH 1/3] sched: Detect per-class runqueue changes
From: Juri Lelli
Date: Tue Oct 07 2025 - 06:08:08 EST
Hi Peter,
On 06/10/25 12:46, Peter Zijlstra wrote:
> Have enqueue/dequeue set a per-class bit in rq->queue_mask. This then
> enables easy tracking of which runqueues are modified over a
> lock-break.
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
> ---
Nice.
> @@ -12887,8 +12888,8 @@ static int sched_balance_newidle(struct
> if (this_rq->cfs.h_nr_queued && !pulled_task)
> pulled_task = 1;
>
> - /* Is there a task of a high priority class? */
> - if (this_rq->nr_running != this_rq->cfs.h_nr_queued)
> + /* If a higher prio class was modified, restart the pick */
> + if (this_rq->queue_mask & ~((fair_sched_class.queue_mask << 1)-1))
> pulled_task = -1;
Does this however want a self-documenting inline helper or macro to make
it even more clear? If this is always going to be the only caller maybe
not so much.
Thanks,
Juri