irqchip/gic-v3-its: Balance initial LPI affinity across CPUs
authorMarc Zyngier <maz@kernel.org>
Fri, 15 May 2020 16:57:52 +0000 (17:57 +0100)
committerMarc Zyngier <maz@kernel.org>
Wed, 20 May 2020 10:00:00 +0000 (11:00 +0100)
commitc5d6082d35e0bcc20a26a067ffcfddcb5257e580
tree240c6bf00817de4aa3f36df02a74e4d29dbb2dc1
parent2f13ff1d1d5c0257c97ea76b86a2d9c99c44a4b9
irqchip/gic-v3-its: Balance initial LPI affinity across CPUs

When mapping a LPI, the ITS driver picks the first possible
affinity, which is in most cases CPU0, assuming that if
that's not suitable, someone will come and set the affinity
to something more interesting.

It apparently isn't the case, and people complain of poor
performance when many interrupts are glued to the same CPU.
So let's place the interrupts by finding the "least loaded"
CPU (that is, the one that has the fewer LPIs mapped to it).
So called 'managed' interrupts are an interesting case where
the affinity is actually dictated by the kernel itself, and
we should honor this.

Reported-by: John Garry <john.garry@huawei.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Tested-by: John Garry <john.garry@huawei.com>
Link: https://lore.kernel.org/r/1575642904-58295-1-git-send-email-john.garry@huawei.com
Link: https://lore.kernel.org/r/20200515165752.121296-3-maz@kernel.org
drivers/irqchip/irq-gic-v3-its.c