From: Prarit Bhargava <prarit@redhat.com>
To: rui wang <ruiv.wang@gmail.com>, Tony Luck <tony.luck@gmail.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
X86-ML <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, "Yu, Fenghua" <fenghua.yu@intel.com>
Subject: Re: [PATCH] x86: Add check for number of available vectors before CPU down [v2]
Date: Mon, 30 Dec 2013 10:09:55 -0500 [thread overview]
Message-ID: <52C18CC3.9080507@redhat.com> (raw)
In-Reply-To: <20131230074434.GA20484@gchen.bj.intel.com>
On 12/30/2013 02:44 AM, Chen, Gong wrote:
> On Sat, Dec 28, 2013 at 12:10:38PM -0500, Prarit Bhargava wrote:
>> Gong and Rui,
>>
>> After looking at this in detail I realized I made a mistake in my patch by
>> including the check for the smp_affinity. Simply put, it shouldn't be there
>> given Rui's explanation above.
>>
>> So I think the patch simply needs to do:
>>
>> 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_count++;
>> }
>> }
>>
>> Can the two of you confirm the above is correct? It would be greatly appreciated.
>>
>
> No, I don't think it is correct. We still need to consider smp_affinity.
>
> fixup_irqs
> irq_set_affinity(native_ioapic_set_affinity)
> __ioapic_set_affinity
> assign_irq_vector
> __assign_irq_vector
> cpu_mask_to_apicid_and
> /* now begin to set ioapic RET */
>
> __assign_irq_vector(int irq, struct irq_cfg *cfg, const struct cpumask *mask)
> {
> ...
> apic->vector_allocation_domain(cpu, tmp_mask, mask);
> ...
> for_each_cpu_and(new_cpu, tmp_mask, cpu_online_mask)
> per_cpu(vector_irq, new_cpu)[vector] = irq;
> cfg->vector = vector;
> cpumask_copy(cfg->domain, tmp_mask);
> ...
> }
>
> On same vecotr on all related vector_irq, irq is set. So such kind of
> irq should happen in multiple vector_irq. In cpu_mask_to_apicid_and(e.g.
> x2apic_cpu_mask_to_apicid_and for cluster mode), apic is updated
> depending on new mask. That's why I think this kind of interrupt
> should be bypassed.
Hmm ... okay. I'll take a closer look at this.
Thanks for the additional information.
P.
next prev parent reply other threads:[~2013-12-30 15:10 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-18 19:29 [PATCH] x86: Add check for number of available vectors before CPU down [v2] Prarit Bhargava
2013-12-18 19:50 ` Tony Luck
2013-12-19 18:05 ` Tony Luck
2013-12-19 18:11 ` Prarit Bhargava
2013-12-20 7:18 ` Chen, Gong
2013-12-20 9:41 ` rui wang
2013-12-20 10:49 ` Prarit Bhargava
2013-12-28 17:10 ` Prarit Bhargava
2013-12-30 7:44 ` Chen, Gong
2013-12-30 15:09 ` Prarit Bhargava [this message]
2013-12-30 12:56 ` rui wang
2013-12-30 15:08 ` Prarit Bhargava
2013-12-31 2:58 ` rui wang
2013-12-31 21:22 ` Prarit Bhargava
2014-01-02 2:41 ` Chen, Gong
2014-01-02 12:57 ` Prarit Bhargava
2014-01-02 16:04 ` Prarit Bhargava
2013-12-30 17:22 ` 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=52C18CC3.9080507@redhat.com \
--to=prarit@redhat.com \
--cc=ak@linux.intel.com \
--cc=fenghua.yu@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=ruiv.wang@gmail.com \
--cc=seiji.aguchi@hds.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@gmail.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