diff options
author | Yinghai Lu <yinghai@kernel.org> | 2014-05-13 11:39:34 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-06-04 08:18:34 -0400 |
commit | ac2a55395eddccd6e3e39532df9869d61e97b2ee (patch) | |
tree | 398113d67fd253cac9189fe566a5db9a401fe358 /arch/x86/kernel/irq.c | |
parent | d2cfd3105094f593bc1fbd0b042a7752ddf08691 (diff) |
x86: irq: Get correct available vectors for cpu disable
check_irq_vectors_for_cpu_disable() can overestimate the number of
available interrupt vectors, so the check for cpu down succeeds, but
the actual cpu removal fails.
It iterates from FIRST_EXTERNAL_VECTOR to NR_VECTORS, which is wrong
because the systems vectors are not taken into account.
Limit the search to first_system_vector instead of NR_VECTORS.
The second indicator for vector availability the used_vectors bitmap
is not taken into account at all. So system vectors,
e.g. IA32_SYSCALL_VECTOR (0x80) and IRQ_MOVE_CLEANUP_VECTOR (0x20),
are accounted as available.
Add a check for the used_vectors bitmap and do not account vectors
which are marked there.
[ tglx: Simplified code. Rewrote changelog and code comments. ]
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Acked-by: Prarit Bhargava <prarit@redhat.com>
Cc: Seiji Aguchi <seiji.aguchi@hds.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: K. Y. Srinivasan <kys@microsoft.com>
Cc: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: "Elliott, Robert (Server Storage)" <Elliott@hp.com>
Cc: x86@kernel.org
Link: http://lkml.kernel.org/r/1400160305-17774-2-git-send-email-prarit@redhat.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/irq.c')
-rw-r--r-- | arch/x86/kernel/irq.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index 283a76a9cc40..11ccfb0a63e7 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <asm/idle.h> | 17 | #include <asm/idle.h> |
18 | #include <asm/mce.h> | 18 | #include <asm/mce.h> |
19 | #include <asm/hw_irq.h> | 19 | #include <asm/hw_irq.h> |
20 | #include <asm/desc.h> | ||
20 | 21 | ||
21 | #define CREATE_TRACE_POINTS | 22 | #define CREATE_TRACE_POINTS |
22 | #include <asm/trace/irq_vectors.h> | 23 | #include <asm/trace/irq_vectors.h> |
@@ -334,10 +335,17 @@ int check_irq_vectors_for_cpu_disable(void) | |||
334 | for_each_online_cpu(cpu) { | 335 | for_each_online_cpu(cpu) { |
335 | if (cpu == this_cpu) | 336 | if (cpu == this_cpu) |
336 | continue; | 337 | continue; |
337 | for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; | 338 | /* |
338 | vector++) { | 339 | * We scan from FIRST_EXTERNAL_VECTOR to first system |
339 | if (per_cpu(vector_irq, cpu)[vector] < 0) | 340 | * vector. If the vector is marked in the used vectors |
340 | count++; | 341 | * bitmap or an irq is assigned to it, we don't count |
342 | * it as available. | ||
343 | */ | ||
344 | for (vector = FIRST_EXTERNAL_VECTOR; | ||
345 | vector < first_system_vector; vector++) { | ||
346 | if (!test_bit(vector, used_vectors) && | ||
347 | per_cpu(vector_irq, cpu)[vector] < 0) | ||
348 | count++; | ||
341 | } | 349 | } |
342 | } | 350 | } |
343 | 351 | ||