public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org, Alan Cox <alan@lxorguk.ukuu.org.uk>,
	"Eric W. Biederman" <ebiederm@xmission.com>
Subject: Re: [PATCH] irq: sparse irqs, fix #2
Date: Thu, 14 Aug 2008 09:33:26 -0700	[thread overview]
Message-ID: <20080814093326.1d8d0a88.akpm@linux-foundation.org> (raw)
In-Reply-To: <20080814133652.GA10972@elte.hu>

On Thu, 14 Aug 2008 15:36:52 +0200 Ingo Molnar <mingo@elte.hu> wrote:

> +static inline cpumask_t vector_allocation_domain(int cpu)
> +{
> +        /* Careful. Some cpus do not strictly honor the set of cpus
> +         * specified in the interrupt destination when using lowest
> +         * priority interrupt delivery mode.
> +         *
> +         * In particular there was a hyperthreading cpu observed to
> +         * deliver interrupts to the wrong hyperthread when only one
> +         * hyperthread was specified in the interrupt desitination.
> +         */
> +        cpumask_t domain = { { [0] = APIC_ALL_CPUS, } };
> +        return domain;
> +}

I haven't looked at callers of this, but...

Does it need to be allocated on the stack?  Local cpumask_t's are a
size problem.  Can we build this in .rodata at compile time instead?

Is this the caller?

+	for_each_cpu_mask(cpu, mask) {
+		cpumask_t domain, new_mask;
+		int new_cpu;
+		int vector;
+
+		domain = vector_allocation_domain(cpu);
+		cpus_and(new_mask, domain, cpu_online_map);

If so we could perhaps do


static noinline const cpumask_t *vector_allocation_domain(int cpu)
{
        /* Careful. Some cpus do not strictly honor the set of cpus
         * specified in the interrupt destination when using lowest
         * priority interrupt delivery mode.
         *
         * In particular there was a hyperthreading cpu observed to
         * deliver interrupts to the wrong hyperthread when only one
         * hyperthread was specified in the interrupt desitination.
         */
        static const cpumask_t domain = { { [0] = APIC_ALL_CPUS, } };
        return &domain;
}


...

+	for_each_cpu_mask(cpu, mask) {
+		cpumask_t domain, new_mask;
+		int new_cpu;
+		int vector;
+
+		__cpus_and(new_mask, vector_allocation_domain(cpu),
+				&cpu_online_map);

otoh, perhaps this new function is one implementation of
genapic.vector_allocation_domain(), in which case the inlining was
unneeded and misleading.

I give up.  Have a little think about the stack bloat, please.

btw, whoever wrote that function is in need of a tab key.

  reply	other threads:[~2008-08-14 16:34 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1218705441-21838-1-git-send-email-yhlu.kernel@gmail.com>
2008-08-14 13:26 ` [PATCH 00/53] dyn_array/nr_irqs/sparse_irq support v10 Ingo Molnar
2008-08-14 13:31   ` [PATCH] irq: sparse irqs, fix Ingo Molnar
2008-08-14 13:36   ` [PATCH] irq: sparse irqs, fix #2 Ingo Molnar
2008-08-14 16:33     ` Andrew Morton [this message]
2008-08-14 17:03       ` Eric W. Biederman
2008-08-14 13:53   ` [PATCH] irq: sparse irqs, fix IRQ auto-probe crash Ingo Molnar
2008-08-14 13:57   ` [PATCH] irq: sparse irqs, export nr_irqs Ingo Molnar
2008-08-14 14:07   ` [PATCH] irq: sparse irqs, fix #3 Ingo Molnar
2008-08-14 17:34     ` Yinghai Lu
2008-08-14 19:01   ` [PATCH 00/53] dyn_array/nr_irqs/sparse_irq support v10 Yinghai Lu
2008-08-14 20:05     ` Eric W. Biederman
2008-08-14 20:42       ` Yinghai Lu
2008-08-14 21:24         ` Yinghai Lu
2008-08-15  0:11           ` Eric W. Biederman
2008-08-15  0:49             ` Yinghai Lu
2008-08-15  1:01               ` Eric W. Biederman
2008-08-15  1:41                 ` Yinghai Lu
2008-08-15  2:33                   ` Eric W. Biederman
2008-08-15  1:09               ` Eric W. Biederman
2008-08-14 23:55         ` Eric W. Biederman
2008-08-15 12:18     ` Ingo Molnar
2008-08-29 21:16   ` Andrew Morton
2008-08-29 21:43     ` Yinghai Lu
2008-08-29 21:49       ` Andrew Morton
2008-08-29 21:54         ` Yinghai Lu

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=20080814093326.1d8d0a88.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=ebiederm@xmission.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=yhlu.kernel@gmail.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