aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu/rcutorture.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2020-06-11 16:43:14 -0700
committerPaul E. McKenney <paulmck@kernel.org>2020-06-29 12:01:44 -0700
commit775227511843202e65a7f194cbf64f38de01f004 (patch)
tree0bc5ef7c51e55bddfb5811ec59f302e9757a97d8 /kernel/rcu/rcutorture.c
parenttorture: Abstract out console-log error detection (diff)
downloadlinux-dev-775227511843202e65a7f194cbf64f38de01f004.tar.xz
linux-dev-775227511843202e65a7f194cbf64f38de01f004.zip
rcutorture: Check for unwatched readers
RCU is supposed to be watching all non-idle kernel code and also all softirq handlers. This commit adds some teeth to this statement by adding a WARN_ON_ONCE(). Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'kernel/rcu/rcutorture.c')
-rw-r--r--kernel/rcu/rcutorture.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 37455a12898e..9c310016585b 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -1377,6 +1377,7 @@ static bool rcu_torture_one_read(struct torture_random_state *trsp)
struct rt_read_seg *rtrsp1;
unsigned long long ts;
+ WARN_ON_ONCE(!rcu_is_watching());
newstate = rcutorture_extend_mask(readstate, trsp);
rcutorture_one_extend(&readstate, newstate, trsp, rtrsp++);
started = cur_ops->get_gp_seq();