Re: [PATCH] irq: sparse irqs, fix #2

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andrew Morton
Date: Thursday, August 14, 2008 - 9:33 am

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


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.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] irq: sparse irqs, fix, Ingo Molnar, (Thu Aug 14, 6:31 am)
[PATCH] irq: sparse irqs, fix #2, Ingo Molnar, (Thu Aug 14, 6:36 am)
[PATCH] irq: sparse irqs, fix IRQ auto-probe crash, Ingo Molnar, (Thu Aug 14, 6:53 am)
[PATCH] irq: sparse irqs, export nr_irqs, Ingo Molnar, (Thu Aug 14, 6:57 am)
[PATCH] irq: sparse irqs, fix #3, Ingo Molnar, (Thu Aug 14, 7:07 am)
Re: [PATCH] irq: sparse irqs, fix #2, Andrew Morton, (Thu Aug 14, 9:33 am)
Re: [PATCH] irq: sparse irqs, fix #2, Eric W. Biederman, (Thu Aug 14, 10:03 am)
Re: [PATCH] irq: sparse irqs, fix #3, Yinghai Lu, (Thu Aug 14, 10:34 am)
Re: [PATCH 00/53] dyn_array/nr_irqs/sparse_irq support v10, Eric W. Biederman, (Thu Aug 14, 1:05 pm)
Re: [PATCH 00/53] dyn_array/nr_irqs/sparse_irq support v10, Eric W. Biederman, (Thu Aug 14, 4:55 pm)
Re: [PATCH 00/53] dyn_array/nr_irqs/sparse_irq support v10, Eric W. Biederman, (Thu Aug 14, 5:11 pm)
Re: [PATCH 00/53] dyn_array/nr_irqs/sparse_irq support v10, Eric W. Biederman, (Thu Aug 14, 6:01 pm)
Re: [PATCH 00/53] dyn_array/nr_irqs/sparse_irq support v10, Eric W. Biederman, (Thu Aug 14, 6:09 pm)
Re: [PATCH 00/53] dyn_array/nr_irqs/sparse_irq support v10, Eric W. Biederman, (Thu Aug 14, 7:33 pm)