Re: [PATCH 1/2] list: add hlist_unhashed_lockless()

From: Paul E. McKenney
Date: Fri Nov 08 2019 - 18:42:29 EST


On Fri, Nov 08, 2019 at 12:17:49PM -0800, Eric Dumazet wrote:
> On Fri, Nov 8, 2019 at 11:24 AM Paul E. McKenney <paulmck@xxxxxxxxxx> wrote:
> >
> > On Thu, Nov 07, 2019 at 11:37:37AM -0800, Eric Dumazet wrote:
> > > We would like to use hlist_unhashed() from timer_pending(),
> > > which runs without protection of a lock.
> > >
> > > Note that other callers might also want to use this variant.
> > >
> > > Instead of forcing a READ_ONCE() for all hlist_unhashed()
> > > callers, add a new helper with an explicit _lockless suffix
> > > in the name to better document what is going on.
> > >
> > > Also add various WRITE_ONCE() in __hlist_del(), hlist_add_head()
> > > and hlist_add_before()/hlist_add_behind() to pair with
> > > the READ_ONCE().
> > >
> > > Signed-off-by: Eric Dumazet <edumazet@xxxxxxxxxx>
> > > Cc: "Paul E. McKenney" <paulmck@xxxxxxxxxx>
> > > Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> >
> > I have queued this, but if you prefer it go some other way:
> >
> > Acked-by: Paul E. McKenney <paulmck@xxxxxxxxxx>
> >
> > But shouldn't the uses in include/linux/rculist.h also be converted
> > into the patch below? If so, I will squash the following into your
> > patch.
> >
> > Thanx, Paul
> >
> > ------------------------------------------------------------------------
>
> Agreed, thanks for the addition of this Paul.

Very good, squashed and pushed, thank you!

Thanx, Paul