[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87d98b6e-b534-408a-bd27-0610de0e81f4@paulmck-laptop>
Date: Fri, 28 Nov 2025 03:21:41 -0800
From: "Paul E. McKenney" <paulmck@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: mingo@...nel.org, vincent.guittot@...aro.org,
linux-kernel@...r.kernel.org, juri.lelli@...hat.com,
dietmar.eggemann@....com, rostedt@...dmis.org, bsegall@...gle.com,
mgorman@...e.de, vschneid@...hat.com, tj@...nel.org,
void@...ifault.com, arighi@...dia.com, changwoo@...lia.com,
sched-ext@...ts.linux.dev
Subject: Re: [PATCH 3/5] sched: Change rcu_dereference_check_sched_domain()
to rcu-sched
On Fri, Nov 28, 2025 at 12:04:16PM +0100, Peter Zijlstra wrote:
> On Fri, Nov 28, 2025 at 11:57:23AM +0100, Peter Zijlstra wrote:
> > On Thu, Nov 27, 2025 at 04:39:46PM +0100, Peter Zijlstra wrote:
> > > By changing rcu_dereference_check_sched_domain() to use
> > > rcu_dereference_sched_check() it also considers preempt_disable() to
> > > be equivalent to rcu_read_lock().
> > >
> > > Since rcu fully implies rcu_sched this has absolutely no change in
> > > behaviour, but it does allow removing a bunch of otherwise redundant
> > > rcu_read_lock() noise.
> >
> > This goes sideways with NUMABALANCING=y, it needs a little more. I'll
> > have a poke.
>
> Bah, so I overlooked that rcu_dereference_sched() checks
> rcu_sched_lock_map while rcu_dereference() checks rcu_lock_map.
>
> Paul, with RCU being unified, how much sense does it make that the rcu
> validation stuff is still fully separated?
>
> Case at hand, I'm trying to remove a bunch of
> rcu_read_lock()/rcu_read_unlock() noise from deep inside the scheduler
> where I know IRQs are disabled.
>
> But the rcu checking thing is still living in the separated universe and
> giving me pain.
Would rcu_dereference_all_check() do what you need? It is happy with an
online CPU that RCU is watching as long as either preemption is disabled
(which includes IRQs being disabled) or any/all of rcu_read_lock(),
rcu_read_lock_bh(), and rcu_read_lock_sched().
Thanx, Paul
Powered by blists - more mailing lists