cpu/hotplug: Make bringup/teardown of smp threads symmetric
authorThomas Gleixner <tglx@linutronix.de>
Tue, 29 May 2018 17:05:25 +0000 (19:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Aug 2018 16:12:51 +0000 (18:12 +0200)
commit c4de65696d865c225fda3b9913b31284ea65ea96 upstream

The asymmetry caused a warning to trigger if the bootup was stopped in state
CPUHP_AP_ONLINE_IDLE. The warning no longer triggers as kthread_park() can
now be invoked on already or still parked threads. But there is still no
reason to have this be asymmetric.

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>
kernel/cpu.c

index d6affe6bd6b62afb62c1b914cdf8285187d1059e..ac08cfbb91671bb33e905aaec8df2d5d3951f069 100644 (file)
@@ -758,7 +758,6 @@ static int takedown_cpu(unsigned int cpu)
 
        /* Park the smpboot threads */
        kthread_park(per_cpu_ptr(&cpuhp_state, cpu)->thread);
-       smpboot_park_threads(cpu);
 
        /*
         * Prevent irq alloc/free while the dying cpu reorganizes the
@@ -1344,7 +1343,7 @@ static struct cpuhp_step cpuhp_ap_states[] = {
        [CPUHP_AP_SMPBOOT_THREADS] = {
                .name                   = "smpboot/threads:online",
                .startup.single         = smpboot_unpark_threads,
-               .teardown.single        = NULL,
+               .teardown.single        = smpboot_park_threads,
        },
        [CPUHP_AP_IRQ_AFFINITY_ONLINE] = {
                .name                   = "irq/affinity:online",