[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aFwFMf3K_hBygBED@Mac.home>
Date: Wed, 25 Jun 2025 07:18:25 -0700
From: Boqun Feng <boqun.feng@...il.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: linux-kernel@...r.kernel.org, rcu@...r.kernel.org, lkmm@...ts.linux.dev,
Ingo Molnar <mingo@...nel.org>, Will Deacon <will@...nel.org>,
Waiman Long <longman@...hat.com>,
Davidlohr Bueso <dave@...olabs.net>,
"Paul E. McKenney" <paulmck@...nel.org>,
Josh Triplett <josh@...htriplett.org>,
Frederic Weisbecker <frederic@...nel.org>,
Neeraj Upadhyay <neeraj.upadhyay@...nel.org>,
Joel Fernandes <joelagnelf@...dia.com>,
Uladzislau Rezki <urezki@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Lai Jiangshan <jiangshanlai@...il.com>,
Zqiang <qiang.zhang@...ux.dev>, Breno Leitao <leitao@...ian.org>,
aeh@...a.com, netdev@...r.kernel.org, edumazet@...gle.com,
jhs@...atatu.com, kernel-team@...a.com,
Erik Lundgren <elundgren@...a.com>
Subject: Re: [PATCH 8/8] locking/lockdep: Use shazptr to protect the key
hashlist
On Wed, Jun 25, 2025 at 01:59:29PM +0200, Peter Zijlstra wrote:
> On Tue, Jun 24, 2025 at 08:11:01PM -0700, Boqun Feng wrote:
>
> > + /* Need preemption disable for using shazptr. */
> > + guard(preempt)();
> > +
> > + /* Protect the list search with shazptr. */
> > + guard(shazptr)(hash_head);
>
> OK, this is the end of the series, and so far every single user is doing
> both a preempt and a shazptr guard. Why can't we simplify this and have
> the shazptr guard imply preempt-disable?
You're right. The background story is that in the beginning, the hazard
pointer protection was placed at the callsites of is_dynamic_key(): one
in register_lock_class() and one in lockdep_init_map_type(), and in
register_lock_class() I could use the fact that it's called with irq
disabled to save the preempt-disable.
So given the current users, it makes sense to fold the preempt disabling
into shazptr guard.
Regards,
Boqun
Powered by blists - more mailing lists