Skip to content

Commit 1137794

Browse files
paulmckrcuNeeraj Upadhyay
authored andcommitted
rcuscale: Provide clear error when async specified without primitives
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]>
1 parent 674fc92 commit 1137794

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
@@ -525,7 +525,7 @@ rcu_scale_writer(void *arg)
525525
schedule_timeout_idle(torture_random(&tr) % writer_holdoff_jiffies + 1);
526526
wdp = &wdpp[i];
527527
*wdp = ktime_get_mono_fast_ns();
528-
if (gp_async) {
528+
if (gp_async && !WARN_ON_ONCE(!cur_ops->async)) {
529529
retry:
530530
if (!rhp)
531531
rhp = kmalloc(sizeof(*rhp), GFP_KERNEL);
@@ -597,7 +597,7 @@ rcu_scale_writer(void *arg)
597597
i++;
598598
rcu_scale_wait_shutdown();
599599
} while (!torture_must_stop());
600-
if (gp_async) {
600+
if (gp_async && cur_ops->async) {
601601
cur_ops->gp_barrier();
602602
}
603603
writer_n_durations[me] = i_max + 1;

0 commit comments

Comments
 (0)