From: Yinghai Lu <yinghai@kernel.org>
To: Ingo Molnar <mingo@elte.hu>, "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Prarit Bhargava <prarit@redhat.com>,
linux-kernel@vger.kernel.org, Yinghai Lu <yinghai@kernel.org>
Subject: [PATCH] x86, irq: get correct available vectors for cpu disable
Date: Sun, 26 Jan 2014 12:34:54 -0800 [thread overview]
Message-ID: <1390768494-17251-1-git-send-email-yinghai@kernel.org> (raw)
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.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
arch/x86/kernel/irq.c | 15 +++++++++++++--
1 file changed, 13 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
@@ -321,8 +321,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++;
}
reply other threads:[~2014-01-26 20:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1390768494-17251-1-git-send-email-yinghai@kernel.org \
--to=yinghai@kernel.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=prarit@redhat.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®