aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2020-02-12 13:29:15 -0800
committerPaul E. McKenney <paulmck@kernel.org>2020-06-29 12:04:48 -0700
commitc93773c1a3fedf6c3f6fa12833e2b74a9897c3e3 (patch)
treefcef149dd6475a765ffe742467188f48b04b986a
parentx86/mm/pat: Mark an intentional data race (diff)
downloadlinux-dev-c93773c1a3fedf6c3f6fa12833e2b74a9897c3e3.tar.xz
linux-dev-c93773c1a3fedf6c3f6fa12833e2b74a9897c3e3.zip
rculist: Add ASSERT_EXCLUSIVE_ACCESS() to __list_splice_init_rcu()
After the sync() in __list_splice_init_rcu(), there should be no readers traversing the old list. This commit therefore enlists the help of KCSAN to verify this condition via a pair of calls to ASSERT_EXCLUSIVE_ACCESS(). Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Cc: Marco Elver <elver@google.com>
-rw-r--r--include/linux/rculist.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index df587d181844..2ebd112f86f7 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -248,6 +248,8 @@ static inline void __list_splice_init_rcu(struct list_head *list,
*/
sync();
+ ASSERT_EXCLUSIVE_ACCESS(*first);
+ ASSERT_EXCLUSIVE_ACCESS(*last);
/*
* Readers are finished with the source list, so perform splice.