Skip to content

Commit cc1fe21

Browse files
committed
cpu/hotplug: Split do_cpu_down()
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>
1 parent c4de656 commit cc1fe21

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

‎kernel/cpu.c‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -906,20 +906,19 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen,
906906
return ret;
907907
}
908908

909+
static int cpu_down_maps_locked(unsigned int cpu, enum cpuhp_state target)
910+
{
911+
if (cpu_hotplug_disabled)
912+
return -EBUSY;
913+
return _cpu_down(cpu, 0, target);
914+
}
915+
909916
static int do_cpu_down(unsigned int cpu, enum cpuhp_state target)
910917
{
911918
int err;
912919

913920
cpu_maps_update_begin();
914-
915-
if (cpu_hotplug_disabled) {
916-
err = -EBUSY;
917-
goto out;
918-
}
919-
920-
err = _cpu_down(cpu, 0, target);
921-
922-
out:
921+
err = cpu_down_maps_locked(cpu, target);
923922
cpu_maps_update_done();
924923
return err;
925924
}

0 commit comments

Comments
 (0)