linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: 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.vnet.ibm.com>
Subject: [PATCH tip/core/rcu 02/17] torture: Bring any extra CPUs online during kernel startup
Date: Sun, 11 Nov 2018 12:20:12 -0800	[thread overview]
Message-ID: <20181111202027.13585-2-paulmck@linux.ibm.com> (raw)
In-Reply-To: <20181111201956.GA11935@linux.ibm.com>

From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>

Currently, the torture scripts rely on the initrd/init script to bring
any extra CPUs online, for example, in the case where the kernel and
qemu have different ideas about how many CPUs are present.  This works,
but is an unnecessary dependency on initrd, which needs to vary depending
on the distro.  This commit therefore causes torture_onoff() to check
for additional CPUs, attempting to bring any found online. Errors are
ignored, just as they are by the initrd/init script.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/torture.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/kernel/torture.c b/kernel/torture.c
index 17d91f5fba2a..9410d1bf84d6 100644
--- a/kernel/torture.c
+++ b/kernel/torture.c
@@ -194,11 +194,23 @@ torture_onoff(void *arg)
 	int cpu;
 	int maxcpu = -1;
 	DEFINE_TORTURE_RANDOM(rand);
+	int ret;
 
 	VERBOSE_TOROUT_STRING("torture_onoff task started");
 	for_each_online_cpu(cpu)
 		maxcpu = cpu;
 	WARN_ON(maxcpu < 0);
+	if (!IS_MODULE(CONFIG_TORTURE_TEST))
+		for_each_possible_cpu(cpu) {
+			if (cpu_online(cpu))
+				continue;
+			ret = cpu_up(cpu);
+			if (ret && verbose) {
+				pr_alert("%s" TORTURE_FLAG
+					 "%s: Initial online %d: errno %d\n",
+					 __func__, torture_type, cpu, ret);
+			}
+		}
 
 	if (maxcpu == 0) {
 		VERBOSE_TOROUT_STRING("Only one CPU, so CPU-hotplug testing is disabled");
-- 
2.17.1


  parent reply	other threads:[~2018-11-11 20:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-11 20:19 [PATCH tip/core/rcu 0/17] Torture-test updates for v4.21/v5.0 Paul E. McKenney
2018-11-11 20:20 ` [PATCH tip/core/rcu 01/17] rcutorture: Add call_rcu() flooding forward-progress tests Paul E. McKenney
2018-11-11 20:20 ` Paul E. McKenney [this message]
2018-11-11 20:20 ` [PATCH tip/core/rcu 03/17] rcutorture: Remove cbflood facility Paul E. McKenney
2018-11-11 20:20 ` [PATCH tip/core/rcu 04/17] rcutorture: Break up too-long rcu_torture_fwd_prog() function Paul E. McKenney
2018-11-11 20:20 ` [PATCH tip/core/rcu 05/17] rcutorture: Affinity forward-progress test to avoid housekeeping CPUs Paul E. McKenney
2018-11-11 20:20 ` [PATCH tip/core/rcu 06/17] torture: Remove unnecessary "ret" variables Paul E. McKenney
2018-11-11 20:20 ` [PATCH tip/core/rcu 07/17] rcutorture: Prepare for asynchronous access to rcu_fwd_startat Paul E. McKenney
2018-11-11 20:20 ` [PATCH tip/core/rcu 08/17] rcutorture: Dump grace-period diagnostics upon forward-progress OOM Paul E. McKenney
2018-11-11 20:20 ` [PATCH tip/core/rcu 09/17] rcu: Account for nocb-CPU callback counts in RCU CPU stall warnings Paul E. McKenney
2018-11-11 20:20 ` [PATCH tip/core/rcu 10/17] rcu: Print per-CPU callback counts for forward-progress failures Paul E. McKenney
2018-11-11 20:20 ` [PATCH tip/core/rcu 11/17] rcutorture: Print GP age upon forward-progress failure Paul E. McKenney
2018-11-11 20:20 ` [PATCH tip/core/rcu 12/17] rcutorture: Print histogram of CB invocation at OOM time Paul E. McKenney
2018-11-11 20:20 ` [PATCH tip/core/rcu 13/17] rcutorture: Print time since GP end upon forward-progress failure Paul E. McKenney
2018-11-11 20:20 ` [PATCH tip/core/rcu 14/17] rcutorture: Print forward-progress test age upon failure Paul E. McKenney
2018-11-11 20:20 ` [PATCH tip/core/rcu 15/17] rcutorture: Recover from OOM during forward-progress tests Paul E. McKenney
2018-11-11 20:20 ` [PATCH tip/core/rcu 16/17] rcutorture: Use 100ms buckets for forward-progress callback histograms Paul E. McKenney
2018-11-11 20:20 ` [PATCH tip/core/rcu 17/17] rcutorture: Don't do busted forward-progress testing 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=20181111202027.13585-2-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=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.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).