[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [tip:irq/urgent] genirq: Revert sparse irq locking around __cpu_up() and move it to x86 for now



Commit-ID:  ce0d3c0a6fb1422101498ef378c0851dabbbf67f
Gitweb:     http://git.kernel.org/tip/ce0d3c0a6fb1422101498ef378c0851dabbbf67f
Author:     Thomas Gleixner <tglx@xxxxxxxxxxxxx>
AuthorDate: Tue, 14 Jul 2015 22:03:57 +0200
Committer:  Thomas Gleixner <tglx@xxxxxxxxxxxxx>
CommitDate: Wed, 15 Jul 2015 10:39:17 +0200

genirq: Revert sparse irq locking around __cpu_up() and move it to x86 for now

Boris reported that the sparse_irq protection around __cpu_up() in the
generic code causes a regression on Xen. Xen allocates interrupts and
some more in the xen_cpu_up() function, so it deadlocks on the
sparse_irq_lock.

There is no simple fix for this and we really should have the
protection for all architectures, but for now the only solution is to
move it to x86 where actual wreckage due to the lack of protection has
been observed.

Reported-and-tested-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
Fixes: a89941816726 'hotplug: Prevent alloc/free of irq descriptors during cpu 
up/down'
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: xiao jin <jin.xiao@xxxxxxxxx>
Cc: Joerg Roedel <jroedel@xxxxxxx>
Cc: Borislav Petkov <bp@xxxxxxx>
Cc: Yanmin Zhang <yanmin_zhang@xxxxxxxxxxxxxxx>
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
---
 arch/x86/kernel/smpboot.c | 11 +++++++++++
 kernel/cpu.c              |  9 ---------
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index d3010aa..b1f3ed9c 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -992,8 +992,17 @@ 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;
        }
@@ -1011,6 +1020,8 @@ int native_cpu_up(unsigned int cpu, struct task_struct 
*tidle)
                touch_nmi_watchdog();
        }
 
+       irq_unlock_sparse();
+
        return 0;
 }
 
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 6a37454..5644ec5 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -527,18 +527,9 @@ static int _cpu_up(unsigned int cpu, int tasks_frozen)
                goto out_notify;
        }
 
-       /*
-        * 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 != 0)
                goto out_notify;
        BUG_ON(!cpu_online(cpu));

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.