Skip to content

Commit 2d56271

Browse files
paulmckrcugregkh
authored andcommitted
rcuscale: Provide clear error when async specified without primitives
[ Upstream commit 1137794 ] Currently, if the rcuscale module's async module parameter is specified for RCU implementations that do not have async primitives such as RCU Tasks Rude (which now lacks a call_rcu_tasks_rude() function), there will be a series of splats due to calls to a NULL pointer. This commit therefore warns of this situation, but switches to non-async testing. Signed-off-by: "Paul E. McKenney" <[email protected]> Signed-off-by: Neeraj Upadhyay <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent fdda354 commit 2d56271

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/rcu/rcuscale.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ rcu_scale_writer(void *arg)
498498
schedule_timeout_idle(torture_random(&tr) % writer_holdoff_jiffies + 1);
499499
wdp = &wdpp[i];
500500
*wdp = ktime_get_mono_fast_ns();
501-
if (gp_async) {
501+
if (gp_async && !WARN_ON_ONCE(!cur_ops->async)) {
502502
retry:
503503
if (!rhp)
504504
rhp = kmalloc(sizeof(*rhp), GFP_KERNEL);
@@ -554,7 +554,7 @@ rcu_scale_writer(void *arg)
554554
i++;
555555
rcu_scale_wait_shutdown();
556556
} while (!torture_must_stop());
557-
if (gp_async) {
557+
if (gp_async && cur_ops->async) {
558558
cur_ops->gp_barrier();
559559
}
560560
writer_n_durations[me] = i_max + 1;

0 commit comments

Comments
 (0)