Skip to content

Commit eb77abf

Browse files
committed
rcuscale: Warn on individual rcu_scale_init() error conditions
When running rcuscale as a module, any rcu_scale_init() issues will be reflected in the error code from modprobe or insmod, as the case may be. However, these error codes are not available when running rcuscale built-in, for example, when using the kvm.sh script. This commit therefore adds WARN_ON_ONCE() to allow distinguishing rcu_scale_init() errors when running rcuscale built-in. Signed-off-by: Paul E. McKenney <[email protected]>
1 parent ed60ad7 commit eb77abf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

kernel/rcu/rcuscale.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ kfree_scale_init(void)
758758
init_waitqueue_head(&shutdown_wq);
759759
firsterr = torture_create_kthread(kfree_scale_shutdown, NULL,
760760
shutdown_task);
761-
if (firsterr)
761+
if (torture_init_error(firsterr))
762762
goto unwind;
763763
schedule_timeout_uninterruptible(1);
764764
}
@@ -775,7 +775,7 @@ kfree_scale_init(void)
775775
for (i = 0; i < kfree_nrealthreads; i++) {
776776
firsterr = torture_create_kthread(kfree_scale_thread, (void *)i,
777777
kfree_reader_tasks[i]);
778-
if (firsterr)
778+
if (torture_init_error(firsterr))
779779
goto unwind;
780780
}
781781

@@ -838,7 +838,7 @@ rcu_scale_init(void)
838838
init_waitqueue_head(&shutdown_wq);
839839
firsterr = torture_create_kthread(rcu_scale_shutdown, NULL,
840840
shutdown_task);
841-
if (firsterr)
841+
if (torture_init_error(firsterr))
842842
goto unwind;
843843
schedule_timeout_uninterruptible(1);
844844
}
@@ -852,7 +852,7 @@ rcu_scale_init(void)
852852
for (i = 0; i < nrealreaders; i++) {
853853
firsterr = torture_create_kthread(rcu_scale_reader, (void *)i,
854854
reader_tasks[i]);
855-
if (firsterr)
855+
if (torture_init_error(firsterr))
856856
goto unwind;
857857
}
858858
while (atomic_read(&n_rcu_scale_reader_started) < nrealreaders)
@@ -879,7 +879,7 @@ rcu_scale_init(void)
879879
}
880880
firsterr = torture_create_kthread(rcu_scale_writer, (void *)i,
881881
writer_tasks[i]);
882-
if (firsterr)
882+
if (torture_init_error(firsterr))
883883
goto unwind;
884884
}
885885
torture_init_end();

0 commit comments

Comments
 (0)