public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Juri Lelli <juri.lelli@redhat.com>
Cc: tj@kernel.org, linux-kernel@vger.kernel.org, mingo@kernel.org,
	vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
	rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
	vschneid@redhat.com, longman@redhat.com, hannes@cmpxchg.org,
	mkoutny@suse.com, void@manifault.com, arighi@nvidia.com,
	changwoo@igalia.com, cgroups@vger.kernel.org,
	sched-ext@lists.linux.dev, liuwenfang@honor.com,
	tglx@linutronix.de
Subject: Re: [RFC][PATCH 1/3] sched: Detect per-class runqueue changes
Date: Tue, 7 Oct 2025 12:16:10 +0200	[thread overview]
Message-ID: <20251007101610.GD3245006@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <aOTmg90J1Tdggm5z@jlelli-thinkpadt14gen4.remote.csb>

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@infradead.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))

  reply	other threads:[~2025-10-07 10:16 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-06 10:46 [RFC][PATCH 0/3] sched/ext: Cleanup pick_task_scx() Peter Zijlstra
2025-10-06 10:46 ` [RFC][PATCH 1/3] sched: Detect per-class runqueue changes Peter Zijlstra
2025-10-07 10:08   ` Juri Lelli
2025-10-07 10:16     ` Peter Zijlstra [this message]
2025-10-07 10:26       ` Juri Lelli
2025-10-16  9:33   ` [tip: sched/core] " tip-bot2 for Peter Zijlstra
2025-10-06 10:46 ` [RFC][PATCH 2/3] sched: Add support to pick functions to take rf Peter Zijlstra
2025-10-08 13:16   ` Vincent Guittot
2025-10-08 13:58     ` Peter Zijlstra
2025-10-08 15:22       ` Vincent Guittot
2025-10-08 20:34         ` Tejun Heo
2025-10-09  7:17           ` Vincent Guittot
2025-10-13 11:04             ` Peter Zijlstra
2025-10-13 11:09               ` Peter Zijlstra
2025-10-13 13:06                 ` Vincent Guittot
2025-10-13 17:20                   ` Tejun Heo
2025-10-16  9:33   ` [tip: sched/core] " tip-bot2 for Joel Fernandes
2025-10-06 10:46 ` [RFC][PATCH 3/3] sched/ext: Fold balance_scx() into pick_task_scx() Peter Zijlstra
2025-10-16  9:33   ` [tip: sched/core] " tip-bot2 for Peter Zijlstra
2025-10-07 12:40 ` [RFC][PATCH 0/3] sched/ext: Cleanup pick_task_scx() Christian Loehle
2025-10-07 21:48 ` Tejun Heo
2025-10-08  9:11   ` Peter Zijlstra
2025-10-08 20:21     ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251007101610.GD3245006@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=arighi@nvidia.com \
    --cc=bsegall@google.com \
    --cc=cgroups@vger.kernel.org \
    --cc=changwoo@igalia.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=hannes@cmpxchg.org \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuwenfang@honor.com \
    --cc=longman@redhat.com \
    --cc=mgorman@suse.de \
    --cc=mingo@kernel.org \
    --cc=mkoutny@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sched-ext@lists.linux.dev \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=void@manifault.com \
    --cc=vschneid@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox