[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251007101610.GD3245006@noisy.programming.kicks-ass.net>
Date: Tue, 7 Oct 2025 12:16:10 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Juri Lelli <juri.lelli@...hat.com>
Cc: tj@...nel.org, linux-kernel@...r.kernel.org, mingo@...nel.org,
vincent.guittot@...aro.org, dietmar.eggemann@....com,
rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
vschneid@...hat.com, longman@...hat.com, hannes@...xchg.org,
mkoutny@...e.com, void@...ifault.com, arighi@...dia.com,
changwoo@...lia.com, cgroups@...r.kernel.org,
sched-ext@...ts.linux.dev, liuwenfang@...or.com, tglx@...utronix.de
Subject: Re: [RFC][PATCH 1/3] sched: Detect per-class runqueue changes
On Tue, Oct 07, 2025 at 12:08:03PM +0200, Juri Lelli wrote:
> 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@...radead.org>
> > ---
>
> 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.
There's another one in patch 3. I suppose we can do that. Maybe
something like:
static inline bool rq_modified_above(struct rq *rq, struct sched_class *class)
{
unsigned int mask = class->queue_mask;
return rq->queue_mask & ~((mask << 1) - 1);
}
This then writes the above like:
if (rq_modified_above(this_rq, &fair_sched_class))
Powered by blists - more mailing lists