Commit 21bccab9 authored by Eric Dumazet's avatar Eric Dumazet Committed by Yang Yingliang
Browse files

list: Add hlist_unhashed_lockless()



mainline inclusion
from mainline-v5.6
commit c54a2744
category: bugfix
bugzilla: 93967
CVE: NA

-----------------------------------------------

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: default avatarEric Dumazet <edumazet@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
[ paulmck: Also add WRITE_ONCE() to rculist.h. ]
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>

 Conflicts:
	include/linux/list.h
[wangxiongfeng: include patch commit ae325dcd ("list: Don't use
WRITE_ONCE() in hlist_add_behind()")]
Signed-off-by: default avatarXiongfeng Wang <wangxiongfeng2@huawei.com>
Reviewed-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 6f1bc69c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment