Skip to content

Commit 457bc8e

Browse files
Qais YousefKAGA-KOKO
authored andcommitted
torture: Replace cpu_up/down() with add/remove_cpu()
The core device API performs extra housekeeping bits that are missing from directly calling cpu_up/down(). See commit a6717c0 ("powerpc/rtas: use device model APIs and serialization during LPM") for an example description of what might go wrong. This also prepares to make cpu_up/down() a private interface of the CPU subsystem. Signed-off-by: Qais Yousef <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: "Paul E. McKenney" <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 20fb502 commit 457bc8e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

kernel/torture.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ bool torture_offline(int cpu, long *n_offl_attempts, long *n_offl_successes,
9797
torture_type, cpu);
9898
starttime = jiffies;
9999
(*n_offl_attempts)++;
100-
ret = cpu_down(cpu);
100+
ret = remove_cpu(cpu);
101101
if (ret) {
102102
if (verbose)
103103
pr_alert("%s" TORTURE_FLAG
@@ -148,7 +148,7 @@ bool torture_online(int cpu, long *n_onl_attempts, long *n_onl_successes,
148148
torture_type, cpu);
149149
starttime = jiffies;
150150
(*n_onl_attempts)++;
151-
ret = cpu_up(cpu);
151+
ret = add_cpu(cpu);
152152
if (ret) {
153153
if (verbose)
154154
pr_alert("%s" TORTURE_FLAG
@@ -192,17 +192,18 @@ torture_onoff(void *arg)
192192
for_each_online_cpu(cpu)
193193
maxcpu = cpu;
194194
WARN_ON(maxcpu < 0);
195-
if (!IS_MODULE(CONFIG_TORTURE_TEST))
195+
if (!IS_MODULE(CONFIG_TORTURE_TEST)) {
196196
for_each_possible_cpu(cpu) {
197197
if (cpu_online(cpu))
198198
continue;
199-
ret = cpu_up(cpu);
199+
ret = add_cpu(cpu);
200200
if (ret && verbose) {
201201
pr_alert("%s" TORTURE_FLAG
202202
"%s: Initial online %d: errno %d\n",
203203
__func__, torture_type, cpu, ret);
204204
}
205205
}
206+
}
206207

207208
if (maxcpu == 0) {
208209
VERBOSE_TOROUT_STRING("Only one CPU, so CPU-hotplug testing is disabled");

0 commit comments

Comments
 (0)