mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Chen, Gong" <gong.chen@linux.intel.com>
To: Prarit Bhargava <prarit@redhat.com>
Cc: linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, Michel Lespinasse <walken@google.com>,
	Andi Kleen <ak@linux.intel.com>,
	Seiji Aguchi <seiji.aguchi@hds.com>,
	Yang Zhang <yang.z.zhang@Intel.com>,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	janet.morgan@Intel.com, tony.luck@Intel.com, ruiv.wang@gmail.com
Subject: Re: [PATCH] x86: Add check for number of available vectors before CPU down [v3]
Date: Mon, 23 Dec 2013 02:12:40 -0500	[thread overview]
Message-ID: <20131223071240.GA18274@gchen.bj.intel.com> (raw)
In-Reply-To: <1387554609-9823-1-git-send-email-prarit@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1429 bytes --]

On Fri, Dec 20, 2013 at 10:50:09AM -0500, Prarit Bhargava wrote:
> +int check_vectors(void)
> +{
> +	int irq, cpu;
> +	unsigned int vector, this_count, count;
> +	struct irq_desc *desc;
> +	struct irq_data *data;
> +	struct cpumask *affinity;
> +
> +	this_count = 0;
> +	for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) {
> +		irq = __this_cpu_read(vector_irq[vector]);
> +		if (irq >= 0) {
> +			desc = irq_to_desc(irq);
> +			data = irq_desc_get_irq_data(desc);
> +			affinity = data->affinity;
> +			if (irq_has_action(irq) || !irqd_is_per_cpu(data) ||
This line looks weird. Why counter will be increased once the irq has
action? Do you mean

if (irq_has_action(irq) && !irqd_is_per_cpu(data) &&
    !cpumask_subset(affinity, cpu_online_mask))


> +			    !cpumask_subset(affinity, cpu_online_mask))
It looks like cpu_online_mask will be updated until cpu_disable_common
is called, but your check_vectors is called before that.

[...]
>  {
> diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
> index 85dc05a..7ac6654 100644
> --- a/arch/x86/kernel/smpboot.c
> +++ b/arch/x86/kernel/smpboot.c
> @@ -1312,6 +1312,12 @@ void cpu_disable_common(void)
>  
>  int native_cpu_disable(void)
>  {
> +	int ret;
> +
> +	ret = check_vectors();
> +	if (ret)
> +		return ret;
> +
>  	clear_local_APIC();
>  
>  	cpu_disable_common();
> -- 
> 1.7.9.3
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  parent reply	other threads:[~2013-12-23  7:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-20 15:50 Prarit Bhargava
2013-12-20 22:56 ` Andi Kleen
2013-12-20 23:06   ` Luck, Tony
2013-12-21  0:08     ` H. Peter Anvin
2013-12-20 23:39 ` [tip:x86/urgent] x86: Add check for number of available vectors before CPU down tip-bot for Prarit Bhargava
2013-12-20 23:39 ` [tip:x86/urgent] x86, irq: Change check_vectors() to check_irq_vectors_for_cpu_disable() tip-bot for H. Peter Anvin
2013-12-23  7:12 ` Chen, Gong [this message]
2013-12-23 12:32   ` [PATCH] x86: Add check for number of available vectors before CPU down [v3] Prarit Bhargava

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=20131223071240.GA18274@gchen.bj.intel.com \
    --to=gong.chen@linux.intel.com \
    --cc=ak@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=janet.morgan@Intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paul.gortmaker@windriver.com \
    --cc=prarit@redhat.com \
    --cc=ruiv.wang@gmail.com \
    --cc=seiji.aguchi@hds.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@Intel.com \
    --cc=walken@google.com \
    --cc=x86@kernel.org \
    --cc=yang.z.zhang@Intel.com \
    /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

Powered by JetHome