torture: Stop onoff task if there is only one cpu
authorBoqun Feng <boqun.feng@gmail.com>
Mon, 2 May 2016 02:30:00 +0000 (10:30 +0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 14 Jun 2016 23:03:28 +0000 (16:03 -0700)
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>
kernel/torture.c

index fb39a06bbef5062b8d3d242d911ac2616ac1eb74..75961b3decfe9489cfa08459a8efba8931a0343a 100644 (file)
@@ -194,6 +194,12 @@ torture_onoff(void *arg)
        for_each_online_cpu(cpu)
                maxcpu = cpu;
        WARN_ON(maxcpu < 0);
+
+       if (maxcpu == 0) {
+               VERBOSE_TOROUT_STRING("Only one CPU, so CPU-hotplug testing is disabled");
+               goto stop;
+       }
+
        if (onoff_holdoff > 0) {
                VERBOSE_TOROUT_STRING("torture_onoff begin holdoff");
                schedule_timeout_interruptible(onoff_holdoff);
@@ -209,6 +215,8 @@ torture_onoff(void *arg)
                                       &sum_online, &min_online, &max_online);
                schedule_timeout_interruptible(onoff_interval);
        }
+
+stop:
        torture_kthread_stopping("torture_onoff");
        return 0;
 }
This page took 0.028584 seconds and 5 git commands to generate.