rcu: Allow rcu_nocbs= to specify all CPUs
authorPaul E. McKenney <paulmck@linux.ibm.com>
Tue, 5 Mar 2019 23:28:19 +0000 (15:28 -0800)
committerPaul E. McKenney <paulmck@linux.ibm.com>
Tue, 26 Mar 2019 21:37:49 +0000 (14:37 -0700)
Currently, the rcu_nocbs= kernel boot parameter requires that a specific
list of CPUs be specified, and has no way to say "all of them".
As noted by user RavFX in a comment to Phoronix topic 1002538, this
is an inconvenient side effect of the removal of the RCU_NOCB_CPU_ALL
Kconfig option.  This commit therefore enables the rcu_nocbs= kernel boot
parameter to be given the string "all", as in "rcu_nocbs=all" to specify
that all CPUs on the system are to have their RCU callbacks offloaded.

Another approach would be to make cpulist_parse() check for "all", but
there are uses of cpulist_parse() that do other checking, which could
conflict with an "all".  This commit therefore focuses on the specific
use of cpulist_parse() in rcu_nocb_setup().

Just a note to other people who would like changes to Linux-kernel RCU:
If you send your requests to me directly, they might get fixed somewhat
faster.  RavFX's comment was posted on January 22, 2018 and I first saw
it on March 5, 2019.  And the only reason that I found it -at- -all- was
that I was looking for projects using RCU, and my search engine showed
me that Phoronix comment quite by accident.  Your choice, though!  ;-)

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Documentation/admin-guide/kernel-parameters.txt
kernel/rcu/tree_plugin.h

index 2b8ee90bb64470d0d6d6ccadccf8b8fbbf86509d..d377a2166b79c92fb19fc4218223ebb5b828c30e 100644 (file)
                                see CONFIG_RAS_CEC help text.
 
        rcu_nocbs=      [KNL]
-                       The argument is a cpu list, as described above.
+                       The argument is a cpu list, as described above,
+                       except that the string "all" can be used to
+                       specify every CPU on the system.
 
                        In kernels built with CONFIG_RCU_NOCB_CPU=y, set
                        the specified list of CPUs to be no-callback CPUs.
index d408661d5fb73dd8cc6ef3bbe202a059e4949074..ed4a6dabf31d0bb362fa7d8f7cf72b5e6abf69cb 100644 (file)
@@ -1776,7 +1776,10 @@ static void zero_cpu_stall_ticks(struct rcu_data *rdp)
 static int __init rcu_nocb_setup(char *str)
 {
        alloc_bootmem_cpumask_var(&rcu_nocb_mask);
-       cpulist_parse(str, rcu_nocb_mask);
+       if (!strcasecmp(str, "all"))
+               cpumask_setall(rcu_nocb_mask);
+       else
+               cpulist_parse(str, rcu_nocb_mask);
        return 1;
 }
 __setup("rcu_nocbs=", rcu_nocb_setup);