]> git.baikalelectronics.ru Git - kernel.git/commit
list: Add hlist_unhashed_lockless()
authorEric Dumazet <edumazet@google.com>
Thu, 7 Nov 2019 19:37:37 +0000 (11:37 -0800)
committerPaul E. McKenney <paulmck@kernel.org>
Mon, 9 Dec 2019 20:36:58 +0000 (12:36 -0800)
commitcf81273618150abc81b7690e0a9ac9ffca3fa7c9
tree467a0ddf6de4ee7d036e9748a4c6c075473932a2
parent408b25ce09bad99fa97fc03c1e76a86ded6db567
list: Add hlist_unhashed_lockless()

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@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
[ paulmck: Also add WRITE_ONCE() to rculist.h. ]
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
include/linux/list.h
include/linux/rculist.h