[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <772d8ec7-e743-4ea8-8d62-6acd80bdbc20@paulmck-laptop>
Date: Thu, 20 Feb 2025 17:26:56 -0800
From: "Paul E. McKenney" <paulmck@...nel.org>
To: Marco Elver <elver@...gle.com>
Cc: Alexander Potapenko <glider@...gle.com>,
Bart Van Assche <bvanassche@....org>,
Bill Wendling <morbo@...gle.com>, Boqun Feng <boqun.feng@...il.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
Frederic Weisbecker <frederic@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Ingo Molnar <mingo@...nel.org>, Jann Horn <jannh@...gle.com>,
Joel Fernandes <joel@...lfernandes.org>,
Jonathan Corbet <corbet@....net>,
Josh Triplett <josh@...htriplett.org>,
Justin Stitt <justinstitt@...gle.com>, Kees Cook <kees@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Miguel Ojeda <ojeda@...nel.org>,
Nathan Chancellor <nathan@...nel.org>,
Neeraj Upadhyay <neeraj.upadhyay@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Peter Zijlstra <peterz@...radead.org>,
Steven Rostedt <rostedt@...dmis.org>,
Thomas Gleixner <tglx@...utronix.de>,
Uladzislau Rezki <urezki@...il.com>,
Waiman Long <longman@...hat.com>, Will Deacon <will@...nel.org>,
kasan-dev@...glegroups.com, linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev, rcu@...r.kernel.org,
linux-crypto@...r.kernel.org
Subject: Re: [PATCH RFC 15/24] rcu: Support Clang's capability analysis
On Fri, Feb 21, 2025 at 01:16:00AM +0100, Marco Elver wrote:
> On Thu, 20 Feb 2025 at 23:36, Paul E. McKenney <paulmck@...nel.org> wrote:
> [...]
> > Suppose that one function walks an RCU-protected list, calling some
> > function from some other subsystem on each element. Suppose that each
> > element has another RCU protected list.
> >
> > It would be good if the two subsystems could just choose their desired
> > flavor of RCU reader, without having to know about each other.
>
> That's what I figured might be the case - thanks for clarifying.
>
> > > Another problem was that if we want to indicate that "RCU" read lock
> > > is held, then we should just be able to write
> > > "__must_hold_shared(RCU)", and it shouldn't matter if rcu_read_lock()
> > > or rcu_read_lock_bh() was used. Previously each of them acquired their
> > > own capability "RCU" and "RCU_BH" respectively. But rather, we're
> > > dealing with one acquiring a superset of the other, and expressing
> > > that is also what I attempted to solve.
> > > Let me rethink this...
> >
> > Would it work to have just one sort of RCU reader, relying on a separate
> > BH-disable capability for the additional semantics of rcu_read_lock_bh()?
>
> That's what I've tried with this patch (rcu_read_lock_bh() also
> acquires "RCU", on top of "RCU_BH"). I need to add a re-entrancy test,
> and make sure it doesn't complain about that. At a later stage we
> might also want to add more general "BH" and "IRQ" capabilities to
> denote they're disabled when held, but that'd overcomplicate the first
> version of this series.
Fair enough! Then would it work to just do "RCU" now, and ad the "BH"
and "IRQ" when those capabilities are added?
Thanx, Paul
Powered by blists - more mailing lists