Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753228AbaAZUtj (ORCPT ); Sun, 26 Jan 2014 15:49:39 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:39771 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752397AbaAZUti (ORCPT ); Sun, 26 Jan 2014 15:49:38 -0500 From: Yinghai Lu To: Ingo Molnar , "H. Peter Anvin" Cc: Thomas Gleixner , Prarit Bhargava , linux-kernel@vger.kernel.org, Yinghai Lu Subject: [PATCH -v2] x86, irq: get correct available vectors for cpu disable Date: Sun, 26 Jan 2014 12:50:16 -0800 Message-Id: <1390769416-2835-1-git-send-email-yinghai@kernel.org> X-Mailer: git-send-email 1.8.4 X-Source-IP: ucsinet22.oracle.com [156.151.31.94] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org assign_irq_vector will stop before first_system_vector. also it will not vector that is set in used_vectors. used_vectors is used to track non per_cpu irq_vector in vector_irq. It include first 32 exception [0,1f) and system vector near 0xfe. and IA32_SYSCALL_VECTOR (0x80), IRQ_MOVE_CLEANUP_VECTOR (0x20). So add checking for them for counting avaiable vectors. -v2: fix compiling problem. Signed-off-by: Yinghai Lu --- arch/x86/kernel/irq.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) Index: linux-2.6/arch/x86/kernel/irq.c =================================================================== --- linux-2.6.orig/arch/x86/kernel/irq.c +++ linux-2.6/arch/x86/kernel/irq.c @@ -17,6 +17,7 @@ #include #include #include +#include #define CREATE_TRACE_POINTS #include @@ -321,8 +322,19 @@ int check_irq_vectors_for_cpu_disable(vo for_each_online_cpu(cpu) { if (cpu == this_cpu) continue; - for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; - vector++) { + + /* + * assign_irq_vector() only use vector under + * first_system_vector and not set in used_vectors bitmask. + * used_vectors could have bits set for + * IA32_SYSCALL_VECTOR (0x80) + * IRQ_MOVE_CLEANUP_VECTOR (0x20) + */ + for (vector = FIRST_EXTERNAL_VECTOR; + vector < first_system_vector; vector++) { + if (test_bit(vector, used_vectors)) + continue; + if (per_cpu(vector_irq, cpu)[vector] < 0) count++; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/