rcu.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.ibm.com>
To: rcu@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, mingo@kernel.org,
	jiangshanlai@gmail.com, dipankar@in.ibm.com,
	akpm@linux-foundation.org, mathieu.desnoyers@efficios.com,
	josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org,
	rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com,
	fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org,
	"Paul E. McKenney" <paulmck@linux.ibm.com>
Subject: [PATCH tip/core/rcu 10/18] rcu: Report error for bad rcu_nocbs= parameter values
Date: Tue, 26 Mar 2019 16:13:06 -0700	[thread overview]
Message-ID: <20190326231314.19518-10-paulmck@linux.ibm.com> (raw)
In-Reply-To: <20190326231253.GA18343@linux.ibm.com>

This commit prints a console message when cpulist_parse() reports a
bad list of CPUs, and sets all CPUs' bits in that case.  The reason for
setting all CPUs' bits is that this is the safe(r) choice for real-time
workloads, which would normally be the ones using the rcu_nocbs= kernel
boot parameter.  Either way, later RCU console log messages list the
actual set of CPUs whose RCU callbacks will be offloaded.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
---
 kernel/rcu/tree_plugin.h | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index ed4a6dabf31d..f0aeb7416dcc 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -1772,14 +1772,22 @@ static void zero_cpu_stall_ticks(struct rcu_data *rdp)
  */
 
 
-/* Parse the boot-time rcu_nocb_mask CPU list from the kernel parameters. */
+/*
+ * Parse the boot-time rcu_nocb_mask CPU list from the kernel parameters.
+ * The string after the "rcu_nocbs=" is either "all" for all CPUs, or a
+ * comma-separated list of CPUs and/or CPU ranges.  If an invalid list is
+ * given, a warning is emitted and all CPUs are offloaded.
+ */
 static int __init rcu_nocb_setup(char *str)
 {
 	alloc_bootmem_cpumask_var(&rcu_nocb_mask);
 	if (!strcasecmp(str, "all"))
 		cpumask_setall(rcu_nocb_mask);
 	else
-		cpulist_parse(str, rcu_nocb_mask);
+		if (cpulist_parse(str, rcu_nocb_mask)) {
+			pr_warn("rcu_nocbs= bad CPU range, all CPUs set\n");
+			cpumask_setall(rcu_nocb_mask);
+		}
 	return 1;
 }
 __setup("rcu_nocbs=", rcu_nocb_setup);
-- 
2.17.1


  parent reply	other threads:[~2019-03-26 23:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-26 23:12 [PATCH tip/core/rcu 0/18] Miscellaneous fixes for v5.2 Paul E. McKenney
2019-03-26 23:12 ` [PATCH tip/core/rcu 01/18] rcu: Unconditionally expedite during suspend/hibernate Paul E. McKenney
2019-03-26 23:12 ` [PATCH tip/core/rcu 02/18] rcu: Avoid unnecessary softirq when system is idle Paul E. McKenney
2019-03-26 23:12 ` [PATCH tip/core/rcu 03/18] rcu: rcu_qs -- Use raise_softirq_irqoff to not save irqs twice Paul E. McKenney
2019-03-26 23:13 ` [PATCH tip/core/rcu 04/18] rcu: Make exit_rcu() handle non-preempted RCU readers Paul E. McKenney
2019-03-26 23:13 ` [PATCH tip/core/rcu 05/18] rcu: Set rcutree.kthread_prio sysfs access to read-only Paul E. McKenney
2019-03-26 23:13 ` [PATCH tip/core/rcu 06/18] MAINTAINERS: RCU now has its own email list Paul E. McKenney
2019-03-26 23:13 ` [PATCH tip/core/rcu 07/18] MAINTAINERS: Add -rcu branch name ("dev") Paul E. McKenney
2019-03-26 23:13 ` [PATCH tip/core/rcu 08/18] rcu: Move common code out of if-else block Paul E. McKenney
2019-03-26 23:13 ` [PATCH tip/core/rcu 09/18] rcu: Allow rcu_nocbs= to specify all CPUs Paul E. McKenney
2019-03-26 23:13 ` Paul E. McKenney [this message]
2019-03-26 23:13 ` [PATCH tip/core/rcu 11/18] rcu: Fix self-wakeups for grace-period kthread Paul E. McKenney
2019-03-26 23:13 ` [PATCH tip/core/rcu 12/18] rcu: Default jiffies_to_sched_qs to jiffies_till_sched_qs Paul E. McKenney
2019-03-26 23:13 ` [PATCH tip/core/rcu 13/18] rcu: Do a single rhp->func read in rcu_head_after_call_rcu() Paul E. McKenney
2019-03-26 23:13 ` [PATCH tip/core/rcu 14/18] rcu: Update jiffies_to_sched_qs and adjust_jiffies_till_sched_qs() comments Paul E. McKenney
2019-03-26 23:13 ` [PATCH tip/core/rcu 15/18] rcu: Fix force_qs_rnp() header comment Paul E. McKenney
2019-03-26 23:13 ` [PATCH tip/core/rcu 16/18] rcu: Eliminate redundant NULL-pointer check Paul E. McKenney
2019-03-26 23:13 ` [PATCH tip/core/rcu 17/18] rcu: Fix typo in tree_exp.h comment Paul E. McKenney
2019-03-26 23:13 ` [PATCH tip/core/rcu 18/18] rcu: Correct READ_ONCE()/WRITE_ONCE() for ->rcu_read_unlock_special Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190326231314.19518-10-paulmck@linux.ibm.com \
    --to=paulmck@linux.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=edumazet@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).