aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoqun Feng <boqun.feng@gmail.com>2016-05-01 22:30:00 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2016-06-14 19:03:28 -0400
commit750db0f5f7d0ff6b86158015f02c275702639b20 (patch)
tree6b97caf5c3f710d6e596cbe7ef7d305236cbe82f
parent682ed706c5bb1526b001bc69aa4ee1e8b456bfa6 (diff)
torture: Stop onoff task if there is only one cpu
If the whole system has only one cpu, that cpu won't be able to be offlined, so there is no need onoff task is stil running. Signed-off-by: Boqun Feng <boqun.feng@gmail.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
-rw-r--r--kernel/torture.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/torture.c b/kernel/torture.c
index fb39a06bbef5..75961b3decfe 100644
--- a/kernel/torture.c
+++ b/kernel/torture.c
@@ -194,6 +194,12 @@ torture_onoff(void *arg)
194 for_each_online_cpu(cpu) 194 for_each_online_cpu(cpu)
195 maxcpu = cpu; 195 maxcpu = cpu;
196 WARN_ON(maxcpu < 0); 196 WARN_ON(maxcpu < 0);
197
198 if (maxcpu == 0) {
199 VERBOSE_TOROUT_STRING("Only one CPU, so CPU-hotplug testing is disabled");
200 goto stop;
201 }
202
197 if (onoff_holdoff > 0) { 203 if (onoff_holdoff > 0) {
198 VERBOSE_TOROUT_STRING("torture_onoff begin holdoff"); 204 VERBOSE_TOROUT_STRING("torture_onoff begin holdoff");
199 schedule_timeout_interruptible(onoff_holdoff); 205 schedule_timeout_interruptible(onoff_holdoff);
@@ -209,6 +215,8 @@ torture_onoff(void *arg)
209 &sum_online, &min_online, &max_online); 215 &sum_online, &min_online, &max_online);
210 schedule_timeout_interruptible(onoff_interval); 216 schedule_timeout_interruptible(onoff_interval);
211 } 217 }
218
219stop:
212 torture_kthread_stopping("torture_onoff"); 220 torture_kthread_stopping("torture_onoff");
213 return 0; 221 return 0;
214} 222}