Skip to content

Commit d2cf085

Browse files
Frederic Weisbeckerpaulmckrcu
authored andcommitted
rcu/nocb: Allow empty "rcu_nocbs" kernel parameter
Allow the rcu_nocbs kernel parameter to be specified just by itself, without specifying any CPUs. This allows systems administrators to use "rcu_nocbs" to specify that none of the CPUs are to be offloaded at boot time, but than any of them may be offloaded at runtime via cpusets. In contrast, if the "rcu_nocbs" or "nohz_full" kernel parameters are not specified at all, then not only are none of the CPUs offloaded at boot, none of them can be offloaded at runtime, either. While in the area, modernize the description of the "rcuo" kthreads' naming scheme. Reviewed-by: Neeraj Upadhyay <quic_neeraju@quicinc.com> Signed-off-by: Frederic Weisbecker <frederic@kernel.org> Cc: Boqun Feng <boqun.feng@gmail.com> Cc: Uladzislau Rezki <urezki@gmail.com> Cc: Josh Triplett <josh@joshtriplett.org> Cc: Joel Fernandes <joel@joelfernandes.org> Tested-by: Juri Lelli <juri.lelli@redhat.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 parent 2cf4528 commit d2cf085

2 files changed

Lines changed: 30 additions & 17 deletions

File tree

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4343,19 +4343,30 @@
43434343
Disable the Correctable Errors Collector,
43444344
see CONFIG_RAS_CEC help text.
43454345

4346-
rcu_nocbs= [KNL]
4347-
The argument is a cpu list, as described above.
4348-
4349-
In kernels built with CONFIG_RCU_NOCB_CPU=y, set
4350-
the specified list of CPUs to be no-callback CPUs.
4351-
Invocation of these CPUs' RCU callbacks will be
4352-
offloaded to "rcuox/N" kthreads created for that
4353-
purpose, where "x" is "p" for RCU-preempt, and
4354-
"s" for RCU-sched, and "N" is the CPU number.
4355-
This reduces OS jitter on the offloaded CPUs,
4356-
which can be useful for HPC and real-time
4357-
workloads. It can also improve energy efficiency
4358-
for asymmetric multiprocessors.
4346+
rcu_nocbs[=cpu-list]
4347+
[KNL] The optional argument is a cpu list,
4348+
as described above.
4349+
4350+
In kernels built with CONFIG_RCU_NOCB_CPU=y,
4351+
enable the no-callback CPU mode, which prevents
4352+
such CPUs' callbacks from being invoked in
4353+
softirq context. Invocation of such CPUs' RCU
4354+
callbacks will instead be offloaded to "rcuox/N"
4355+
kthreads created for that purpose, where "x" is
4356+
"p" for RCU-preempt, "s" for RCU-sched, and "g"
4357+
for the kthreads that mediate grace periods; and
4358+
"N" is the CPU number. This reduces OS jitter on
4359+
the offloaded CPUs, which can be useful for HPC
4360+
and real-time workloads. It can also improve
4361+
energy efficiency for asymmetric multiprocessors.
4362+
4363+
If a cpulist is passed as an argument, the specified
4364+
list of CPUs is set to no-callback mode from boot.
4365+
4366+
Otherwise, if the '=' sign and the cpulist
4367+
arguments are omitted, no CPU will be set to
4368+
no-callback mode from boot but the mode may be
4369+
toggled at runtime via cpusets.
43594370

43604371
rcu_nocb_poll [KNL]
43614372
Rather than requiring that offloaded CPUs

kernel/rcu/tree_nocb.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,16 @@ static bool rcu_nocb_is_setup;
6666
static int __init rcu_nocb_setup(char *str)
6767
{
6868
alloc_bootmem_cpumask_var(&rcu_nocb_mask);
69-
if (cpulist_parse(str, rcu_nocb_mask)) {
70-
pr_warn("rcu_nocbs= bad CPU range, all CPUs set\n");
71-
cpumask_setall(rcu_nocb_mask);
69+
if (*str == '=') {
70+
if (cpulist_parse(++str, rcu_nocb_mask)) {
71+
pr_warn("rcu_nocbs= bad CPU range, all CPUs set\n");
72+
cpumask_setall(rcu_nocb_mask);
73+
}
7274
}
7375
rcu_nocb_is_setup = true;
7476
return 1;
7577
}
76-
__setup("rcu_nocbs=", rcu_nocb_setup);
78+
__setup("rcu_nocbs", rcu_nocb_setup);
7779

7880
static int __init parse_rcu_nocb_poll(char *arg)
7981
{

0 commit comments

Comments
 (0)