Re: [PATCH 2/2 v2] x86, make check_irq_vectors_for_cpu_disable() aware of numa node irqs

From: Thomas Gleixner
Date: Wed Jun 04 2014 - 08:44:00 EST


On Thu, 15 May 2014, Prarit Bhargava wrote:
> +/* This array is used to keep track of how many empty vectors each cpu has. */
> +static int empty_vectors[NR_CPUS];
> +

No way! The whole vector accounting is a steaming pile of sh*t.

This needs to be fixed at the root of the problem, not by sh*tting on
top of the existing pile!

And the root of the problem is, that we do not have a uniform way to
access the empty vectors. Instead we have a bitmap, constants a
variable upper limit and the vector array. And you certainly noticed
that.

So why on earth are you trying to "fix" the issue by doing loops and
hoops on cpu unplug instead of doing a proper accounting in the first
place? It's all known prior to the point where you unplug a cpu.

FYI, don't try and add some crappy accounting hackery into the
existing vector allocation code. It's doomed.

Jiang is currently rewriting the ioapic code to use irq domains to
support physical ioapic hotplug. The next step is to move the
underlying vector allocation to irqdomains. When this happens we can
add the proper accounting.

That will allow us to support that unplug thing proper including
things like multi-MSI, which you cannot support with your bandaid
hackery at all.

Thanks,

tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/