Commit 373b8def authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Greg Kroah-Hartman

cpu/hotplug: Split do_cpu_down()

commit cc1fe215 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: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: default avatarIngo Molnar <mingo@kernel.org>
Signed-off-by: default avatarDavid Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9333575f
...@@ -955,20 +955,19 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen, ...@@ -955,20 +955,19 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen,
return ret; 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) static int do_cpu_down(unsigned int cpu, enum cpuhp_state target)
{ {
int err; int err;
cpu_maps_update_begin(); cpu_maps_update_begin();
err = cpu_down_maps_locked(cpu, target);
if (cpu_hotplug_disabled) {
err = -EBUSY;
goto out;
}
err = _cpu_down(cpu, 0, target);
out:
cpu_maps_update_done(); cpu_maps_update_done();
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment