From: "Chen, Gong" <gong.chen@linux.intel.com>
To: Prarit Bhargava <prarit@redhat.com>
Cc: linux-kernel@vger.kernel.org, Andi Kleen <ak@linux.intel.com>,
Michel Lespinasse <walken@google.com>,
Seiji Aguchi <seiji.aguchi@hds.com>,
Yang Zhang <yang.z.zhang@Intel.com>,
Paul Gortmaker <paul.gortmaker@windriver.com>,
Janet Morgan <janet.morgan@Intel.com>,
Tony Luck <tony.luck@Intel.com>, Ruiv Wang <ruiv.wang@gmail.com>,
"H. Peter Anvin" <hpa@linux.intel.com>,
x86@kernel.org
Subject: Re: [PATCH] x86: Add check for number of available vectors before CPU down [v4]
Date: Thu, 2 Jan 2014 21:25:24 -0500 [thread overview]
Message-ID: <20140103022524.GB1913@gchen.bj.intel.com> (raw)
In-Reply-To: <1388710044-8280-1-git-send-email-prarit@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1537 bytes --]
Add some nitpicks below.
Reviewed-by: Chen, Gong <gong.chen@linux.intel.com>
On Thu, Jan 02, 2014 at 07:47:24PM -0500, Prarit Bhargava wrote:
> +int check_irq_vectors_for_cpu_disable(void)
> +{
> + int irq, cpu;
> + unsigned int vector, this_count, count;
> + struct irq_desc *desc;
> + struct irq_data *data;
> + struct cpumask affinity_new, online_new;
> +
> + cpumask_copy(&online_new, cpu_online_mask);
> + cpu_clear(smp_processor_id(), online_new);
I notice that you use smp_processor_id() many times. Maybe we can
save it first for speed.
> +
> + 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);
> + cpumask_copy(&affinity_new, data->affinity);
> + cpu_clear(smp_processor_id(), affinity_new);
> + /*
> + * Only count active non-percpu irqs, and those
> + * irqs that are not linked to on an online cpu; in
> + * fixup_irqs(), chip->irq_set_affinity() will be
> + * called which will set vector_irq[irq] for each
> + * cpu.
> + */
> + if (irq_has_action(irq) && !irqd_is_per_cpu(data) &&
> + (cpumask_empty(&affinity_new) ||
> + !cpumask_subset(&affinity_new, &online_new)))
> + this_count++;
Would you please add some extra comments to describe these two different
conditions that cpumask is empty and non-empty. I feel it is a little bit
sutble and I don't expect I'm confused by myself one day :-).
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
prev parent reply other threads:[~2014-01-03 2:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-03 0:47 Prarit Bhargava
2014-01-03 2:25 ` Chen, Gong [this message]
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=20140103022524.GB1913@gchen.bj.intel.com \
--to=gong.chen@linux.intel.com \
--cc=ak@linux.intel.com \
--cc=hpa@linux.intel.com \
--cc=janet.morgan@Intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paul.gortmaker@windriver.com \
--cc=prarit@redhat.com \
--cc=ruiv.wang@gmail.com \
--cc=seiji.aguchi@hds.com \
--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