refscale: Warn on individual ref_scale_init() error conditions
authorPaul E. McKenney <paulmck@kernel.org>
Thu, 5 Aug 2021 22:57:12 +0000 (15:57 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Mon, 13 Sep 2021 23:36:16 +0000 (16:36 -0700)
When running refscale as a module, any ref_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 refscale
built-in, for example, when using the kvm.sh script.  This commit
therefore adds WARN_ON_ONCE() to allow distinguishing ref_scale_init()
errors when running refscale built-in.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/refscale.c

index 66dc14c..1631ef8 100644 (file)
@@ -824,7 +824,7 @@ ref_scale_init(void)
                init_waitqueue_head(&shutdown_wq);
                firsterr = torture_create_kthread(ref_scale_shutdown, NULL,
                                                  shutdown_task);
-               if (firsterr)
+               if (torture_init_error(firsterr))
                        goto unwind;
                schedule_timeout_uninterruptible(1);
        }
@@ -851,7 +851,7 @@ ref_scale_init(void)
        for (i = 0; i < nreaders; i++) {
                firsterr = torture_create_kthread(ref_scale_reader, (void *)i,
                                                  reader_tasks[i].task);
-               if (firsterr)
+               if (torture_init_error(firsterr))
                        goto unwind;
 
                init_waitqueue_head(&(reader_tasks[i].wq));
@@ -860,7 +860,7 @@ ref_scale_init(void)
        // Main Task
        init_waitqueue_head(&main_wq);
        firsterr = torture_create_kthread(main_func, NULL, main_task);
-       if (firsterr)
+       if (torture_init_error(firsterr))
                goto unwind;
 
        torture_init_end();