hotplug: Prevent alloc/free of irq descriptors during cpu up/down (again)
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>
Wed, 3 Aug 2016 17:22:28 +0000 (13:22 -0400)
committerDavid Vrabel <david.vrabel@citrix.com>
Wed, 24 Aug 2016 17:44:46 +0000 (18:44 +0100)
Now that Xen no longer allocates irqs in _cpu_up() we can restore
commit a89941816726 ("hotplug: Prevent alloc/free of irq descriptors
during cpu up/down")

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
CC: x86@kernel.org
CC: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
arch/x86/kernel/smpboot.c
kernel/cpu.c

index 4296beb8fdd3b2d91a9644c9843d66dd2132c2ad..26b473dc3f8223ae19575bdc75a2164e00ba1801 100644 (file)
@@ -1115,17 +1115,8 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle)
 
        common_cpu_up(cpu, tidle);
 
-       /*
-        * We have to walk the irq descriptors to setup the vector
-        * space for the cpu which comes online.  Prevent irq
-        * alloc/free across the bringup.
-        */
-       irq_lock_sparse();
-
        err = do_boot_cpu(apicid, cpu, tidle);
-
        if (err) {
-               irq_unlock_sparse();
                pr_err("do_boot_cpu failed(%d) to wakeup CPU#%u\n", err, cpu);
                return -EIO;
        }
@@ -1143,8 +1134,6 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle)
                touch_nmi_watchdog();
        }
 
-       irq_unlock_sparse();
-
        return 0;
 }
 
index 341bf80f80bd685d529db77f6c4afdeda05f28ae..ec12b726fa6f056dda3176055619fdf5ce06982a 100644 (file)
@@ -349,8 +349,16 @@ static int bringup_cpu(unsigned int cpu)
        struct task_struct *idle = idle_thread_get(cpu);
        int ret;
 
+       /*
+        * Some architectures have to walk the irq descriptors to
+        * setup the vector space for the cpu which comes online.
+        * Prevent irq alloc/free across the bringup.
+        */
+       irq_lock_sparse();
+
        /* Arch-specific enabling code. */
        ret = __cpu_up(cpu, idle);
+       irq_unlock_sparse();
        if (ret) {
                cpu_notify(CPU_UP_CANCELED, cpu);
                return ret;