From: Prarit Bhargava <prarit@redhat.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>, "H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] x86, irq: get correct available vectors for cpu disable
Date: Thu, 06 Feb 2014 14:12:36 -0500 [thread overview]
Message-ID: <52F3DEA4.5090806@redhat.com> (raw)
In-Reply-To: <1390946045-2769-1-git-send-email-yinghai@kernel.org>
On 01/28/2014 04:54 PM, Yinghai Lu wrote:
> used_vectors is a bitmap for vectors that are not tracked in per_cpu
> vector_irq.
> used_vectors contains information on the first 32 exceptions, the system vectors.
> the IA32_SYSCALL_VECTOR (0x80), and the IRQ_MOVE_CLEANUP_VECTOR (0x20).
>
> assign_irq_vectors() assigns vectors up to first_system_vector and
> it will not use vectors that are set used_vectors.
>
> This patch modifies the code to scan up to first_system_vector
> and do a test on the used_vectors bitmap.
>
> So count avaiable vectors correctly.
>
> -v2: fix compiling problem.
> -v3: update changelog and commets
>
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
>
> ---
> arch/x86/kernel/irq.c | 18 ++++++++++++++++--
> 1 file changed, 16 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 <asm/idle.h>
> #include <asm/mce.h>
> #include <asm/hw_irq.h>
> +#include <asm/desc.h>
>
> #define CREATE_TRACE_POINTS
> #include <asm/trace/irq_vectors.h>
> @@ -321,8 +322,21 @@ 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 scan per_cpu vectors from
> + * FIRST_EXTERNAL_VECTOR to first_system_vector.
> + * It aslo skip vectors that are set in used_vectors bitmask.
"also" ... but not a big deal IMO.
Reviewed-by: Prarit Bhargava <prarit@redhat.com>
Tested-by: Prarit Bhargava <prarit@redhat.com>
P.
> + * used_vectors could have bits set for
> + * IA32_SYSCALL_VECTOR (0x80)
> + * IRQ_MOVE_CLEANUP_VECTOR (0x20)
> + * Don't count those as available vectors.
> + */
> + 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++;
> }
next prev parent reply other threads:[~2014-02-06 19:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-28 21:54 [PATCH v3] x86, irq: get correct available vectors for cpu disable Yinghai Lu
2014-01-31 13:14 ` Prarit Bhargava
2014-02-06 19:12 ` Prarit Bhargava [this message]
2014-03-25 20:03 ` Linn Crosetto
2014-03-26 0:18 ` Yinghai Lu
2014-03-26 16:50 ` Linn Crosetto
2014-03-26 17:04 ` Yinghai Lu
2014-03-26 18:55 ` Linn Crosetto
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=52F3DEA4.5090806@redhat.com \
--to=prarit@redhat.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=yinghai@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.