aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2017-07-20 18:27:32 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2017-07-24 19:04:19 -0400
commitf34c8585ed70f0f9b5ff9cf59c0dd533cddb975f (patch)
tree1837b859d9d6c4386ac2c40c0c9c7fdc8fe52382 /kernel/rcu
parent96036c43066a04c99353abb4a342cc38a52d36f2 (diff)
rcutorture: Invoke call_rcu() from timer handler
The Linux kernel invokes call_rcu() from various interrupt/softirq handlers, but rcutorture does not. This commit therefore adds this behavior to rcutorture's repertoire. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcu')
-rw-r--r--kernel/rcu/rcutorture.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 6e3f644280ee..0efd69b2fb8c 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -1080,6 +1080,11 @@ rcu_torture_fakewriter(void *arg)
1080 return 0; 1080 return 0;
1081} 1081}
1082 1082
1083static void rcu_torture_timer_cb(struct rcu_head *rhp)
1084{
1085 kfree(rhp);
1086}
1087
1083/* 1088/*
1084 * RCU torture reader from timer handler. Dereferences rcu_torture_current, 1089 * RCU torture reader from timer handler. Dereferences rcu_torture_current,
1085 * incrementing the corresponding element of the pipeline array. The 1090 * incrementing the corresponding element of the pipeline array. The
@@ -1142,6 +1147,14 @@ static void rcu_torture_timer(unsigned long unused)
1142 __this_cpu_inc(rcu_torture_batch[completed]); 1147 __this_cpu_inc(rcu_torture_batch[completed]);
1143 preempt_enable(); 1148 preempt_enable();
1144 cur_ops->readunlock(idx); 1149 cur_ops->readunlock(idx);
1150
1151 /* Test call_rcu() invocation from interrupt handler. */
1152 if (cur_ops->call) {
1153 struct rcu_head *rhp = kmalloc(sizeof(*rhp), GFP_NOWAIT);
1154
1155 if (rhp)
1156 cur_ops->call(rhp, rcu_torture_timer_cb);
1157 }
1145} 1158}
1146 1159
1147/* 1160/*