Skip to content

Commit

Permalink
torture: Stop onoff task if there is only one cpu
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Paul E. McKenney <[email protected]>
  • Loading branch information
fbq authored and paulmck committed Jun 14, 2016
1 parent 682ed70 commit 750db0f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions kernel/torture.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}
Expand Down

0 comments on commit 750db0f

Please sign in to comment.