From: Paul E. McKenney <paul.mckenney@linaro.org>
Date: Mon, 24 Sep 2012 23:08:31 +0000 (-0700)
Subject: rcu: Make rcutorture give diagnostics if CPU offline fails
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=489832609a1ad7189d11715d8cefb457d90182c5;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git

rcu: Make rcutorture give diagnostics if CPU offline fails

This commit causes rcutorture to print the errno if cpu_down() fails
when the rcutorture "verbose" module parameter is specified.

Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---

diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c
index aaa7b9f3532a..9900f560f1bd 100644
--- a/kernel/rcutorture.c
+++ b/kernel/rcutorture.c
@@ -1502,6 +1502,7 @@ rcu_torture_onoff(void *arg)
 	unsigned long delta;
 	int maxcpu = -1;
 	DEFINE_RCU_RANDOM(rand);
+	int ret;
 	unsigned long starttime;
 
 	VERBOSE_PRINTK_STRING("rcu_torture_onoff task started");
@@ -1522,7 +1523,13 @@ rcu_torture_onoff(void *arg)
 					 torture_type, cpu);
 			starttime = jiffies;
 			n_offline_attempts++;
-			if (cpu_down(cpu) == 0) {
+			ret = cpu_down(cpu);
+			if (ret) {
+				if (verbose)
+					pr_alert("%s" TORTURE_FLAG
+						 "rcu_torture_onoff task: offline %d failed: errno %d\n",
+						 torture_type, cpu, ret);
+			} else {
 				if (verbose)
 					pr_alert("%s" TORTURE_FLAG
 						 "rcu_torture_onoff task: offlined %d\n",