[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180430153505.GW26088@linux.vnet.ibm.com>
Date: Mon, 30 Apr 2018 08:35:05 -0700
From: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Josh Triplett <josh@...htriplett.org>, NeilBrown <neilb@...e.com>,
Trond Myklebust <trond.myklebust@...marydata.com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Anna Schumaker <anna.schumaker@...app.com>,
linux-nfs@...r.kernel.org, Lai Jiangshan <jiangshanlai@...il.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/4] rculist: add list_for_each_entry_from_rcu()
On Mon, Apr 30, 2018 at 11:14:54AM -0400, Steven Rostedt wrote:
> On Mon, 30 Apr 2018 06:43:08 -0700
> "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com> wrote:
>
> > On Sun, Apr 29, 2018 at 10:20:33PM -0700, Josh Triplett wrote:
> > > On Mon, Apr 30, 2018 at 02:31:30PM +1000, NeilBrown wrote:
> > > > list_for_each_entry_from_rcu() is an RCU version of
> > > > list_for_each_entry_from(). It walks a linked list under rcu
> > > > protection, from a given start point.
> > > >
> > > > It is similar to list_for_each_entry_continue_rcu() but starts *at*
> > > > the given position rather than *after* it.
> > > >
> > > > Naturally, the start point must be known to be in the list.
> > >
> > > I'd suggest giving an explicit advisory comment to clarify and suggest
> > > correct usage:
> > >
> > > "This would typically require either that you obtained the node from a
> > > previous walk of the list in the same RCU read-side critical section, or
> > > that you held some sort of non-RCU reference (such as a reference count)
> > > to keep the node alive *and* in the list."
> > >
> > > (Feel free to wordsmith the exact wording, but something like that seems
> > > like it would help people understand how to use this correctly, and make
> > > it less likely that they'd use it incorrectly.)
> >
> > What Josh said! Could you also contrast this with the existing
> > list_for_each_entry_continue_rcu() macro in the header comment as well
> > as in the commit log?
>
> Should Documentation/RCU/whatisRCU.txt be updated?
>
> Specifically section: 7. FULL LIST OF RCU APIs
Very much so, thank you for catching this!
Thanx, Paul
Powered by blists - more mailing lists