[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAEXW_YR69RRNZfkfFyvprs5+VKBGu29h0_-gnQmuNhN54+ReHQ@mail.gmail.com>
Date: Sat, 25 May 2019 13:07:12 +0300
From: Joel Fernandes <joel@...lfernandes.org>
To: "Paul E. McKenney" <paulmck@...ux.ibm.com>
Cc: LKML <linux-kernel@...r.kernel.org>, rcu <rcu@...r.kernel.org>,
Josh Triplett <josh@...htriplett.org>,
Steven Rostedt <rostedt@...dmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Lai Jiangshan <jiangshanlai@...il.com>,
Jonathan Corbet <corbet@....net>,
"open list:DOCUMENTATION" <linux-doc@...r.kernel.org>
Subject: Re: [PATCH] doc/rcu: Correct field_count field naming in examples
On Wed, May 8, 2019 at 9:16 PM Paul E. McKenney <paulmck@...ux.ibm.com> wrote:
[snip]
> > > And this example code predates v2.6.12. ;-)
> > >
> > > So good eyes, but I believe that this really does reflect the ancient
> > > code...
> > >
> > > On the other hand, would you have ideas for more modern replacement
> > > examples?
> >
> > There are 3 cases I can see in listRCU.txt:
> > (1) action taken outside of read_lock (can tolerate stale data), no in-place update.
> > this is the best possible usage of RCU.
> > (2) action taken outside of read_lock, in-place updates
> > this is good as long as not too many in-place updates.
> > involves copying creating new list node and replacing the
> > node being updated with it.
> > (3) cannot tolerate stale data: here a deleted or obsolete flag can be used
> > protected by a per-entry lock. reader
> > aborts if object is stale.
> >
> > Any replacement example must make satisfy (3) too?
>
> It would be OK to have a separate example for (3). It would of course
> be nicer to have one example for all three, but not all -that- important.
>
> > The only example for (3) that I know of is sysvipc sempahores which you also
> > mentioned in the paper. Looking through this code, it hasn't changed
> > conceptually and it could be a fit for an example (ipc_valid_object() checks
> > for whether the object is stale).
>
> That is indeed the classic canonical example. ;-)
FWIW just want to mention, it seems to me the ptrace task list
traversal could be a great example of "mark obsolete objects" and is
simple so I could just use that.
Neil talks about it in his article here:
https://lwn.net/Articles/610972/ . In "Group 3: Transform the way the
list is walked"
Cheers,
- Joel
Powered by blists - more mailing lists