History

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.

Paul E. McKenney committed 5 years ago

Commit eb77abf1 parent ed60ad71 file · +5 −5Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/rcu/rcuscale.c+5−5
@@ -758,7 +758,7 @@ kfree_scale_init(void) · 757 unmodified lines
758 init_waitqueue_head(&shutdown_wq);758 init_waitqueue_head(&shutdown_wq);
759 firsterr = torture_create_kthread(kfree_scale_shutdown, NULL,759 firsterr = torture_create_kthread(kfree_scale_shutdown, NULL,
760 shutdown_task);760 shutdown_task);
761 if (firsterr)761 if (torture_init_error(firsterr))
762 goto unwind;762 goto unwind;
763 schedule_timeout_uninterruptible(1);763 schedule_timeout_uninterruptible(1);
764 }764 }
@@ -775,7 +775,7 @@ kfree_scale_init(void) · 10 unmodified lines
775 for (i = 0; i < kfree_nrealthreads; i++) {775 for (i = 0; i < kfree_nrealthreads; i++) {
776 firsterr = torture_create_kthread(kfree_scale_thread, (void *)i,776 firsterr = torture_create_kthread(kfree_scale_thread, (void *)i,
777 kfree_reader_tasks[i]);777 kfree_reader_tasks[i]);
778 if (firsterr)778 if (torture_init_error(firsterr))
779 goto unwind;779 goto unwind;
780 }780 }
781 781
@@ -838,7 +838,7 @@ rcu_scale_init(void) · 56 unmodified lines
838 init_waitqueue_head(&shutdown_wq);838 init_waitqueue_head(&shutdown_wq);
839 firsterr = torture_create_kthread(rcu_scale_shutdown, NULL,839 firsterr = torture_create_kthread(rcu_scale_shutdown, NULL,
840 shutdown_task);840 shutdown_task);
841 if (firsterr)841 if (torture_init_error(firsterr))
842 goto unwind;842 goto unwind;
843 schedule_timeout_uninterruptible(1);843 schedule_timeout_uninterruptible(1);
844 }844 }
@@ -852,7 +852,7 @@ rcu_scale_init(void) · 7 unmodified lines
852 for (i = 0; i < nrealreaders; i++) {852 for (i = 0; i < nrealreaders; i++) {
853 firsterr = torture_create_kthread(rcu_scale_reader, (void *)i,853 firsterr = torture_create_kthread(rcu_scale_reader, (void *)i,
854 reader_tasks[i]);854 reader_tasks[i]);
855 if (firsterr)855 if (torture_init_error(firsterr))
856 goto unwind;856 goto unwind;
857 }857 }
858 while (atomic_read(&n_rcu_scale_reader_started) < nrealreaders)858 while (atomic_read(&n_rcu_scale_reader_started) < nrealreaders)
@@ -879,7 +879,7 @@ rcu_scale_init(void) · 20 unmodified lines
879 }879 }
880 firsterr = torture_create_kthread(rcu_scale_writer, (void *)i,880 firsterr = torture_create_kthread(rcu_scale_writer, (void *)i,
881 writer_tasks[i]);881 writer_tasks[i]);
882 if (firsterr)882 if (torture_init_error(firsterr))
883 goto unwind;883 goto unwind;
884 }884 }
885 torture_init_end();885 torture_init_end();