diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2018-05-29 17:49:05 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-08-15 17:37:26 +0200 |
commit | 74f1c7a26b6064f278a9f2ae0c30d4c23955e835 (patch) | |
tree | a7302b0498f9164f84ff2cc8585742f522c791f5 | |
parent | 6249d3232f222d454a4da3e6ac7efd01137f8400 (diff) | |
download | linux-74f1c7a26b6064f278a9f2ae0c30d4c23955e835.tar.gz |
cpu/hotplug: Split do_cpu_down()
commit cc1fe215e1efa406b03aa4389e6269b61342dec5 upstream.
Split out the inner workings of do_cpu_down() to allow reuse of that
function for the upcoming SMT disabling mechanism.
No functional change.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | kernel/cpu.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c index 7e811e2c32d28..90ca45b45e3a4 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -906,20 +906,19 @@ out: return ret; } +static int cpu_down_maps_locked(unsigned int cpu, enum cpuhp_state target) +{ + if (cpu_hotplug_disabled) + return -EBUSY; + return _cpu_down(cpu, 0, target); +} + static int do_cpu_down(unsigned int cpu, enum cpuhp_state target) { int err; cpu_maps_update_begin(); - - if (cpu_hotplug_disabled) { - err = -EBUSY; - goto out; - } - - err = _cpu_down(cpu, 0, target); - -out: + err = cpu_down_maps_locked(cpu, target); cpu_maps_update_done(); return err; } |