diff options
author | Prarit Bhargava <prarit@redhat.com> | 2012-03-26 15:02:18 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2012-03-29 05:31:53 -0400 |
commit | 241fc640be783f903e74b6d9c68481c01873f758 (patch) | |
tree | 253793b9f94721554c3aa2b286ca27052b3390e8 /kernel | |
parent | f3f79e38d51f8a419f4c484a86ece4baea35b993 (diff) |
genirq: Respect NUMA node affinity in setup_irq_irq affinity()
We respect node affinity of devices already in the irq descriptor
allocation, but we ignore it for the initial interrupt affinity
setup, so the interrupt might be routed to a different node.
Restrict the default affinity mask to the node on which the irq
descriptor is allocated.
[ tglx: Massaged changelog ]
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Link: http://lkml.kernel.org/r/1332788538-17425-1-git-send-email-prarit@redhat.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/irq/manage.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index bf606a53a21c..89a3ea82569b 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
@@ -282,7 +282,7 @@ setup_affinity(unsigned int irq, struct irq_desc *desc, struct cpumask *mask) | |||
282 | { | 282 | { |
283 | struct irq_chip *chip = irq_desc_get_chip(desc); | 283 | struct irq_chip *chip = irq_desc_get_chip(desc); |
284 | struct cpumask *set = irq_default_affinity; | 284 | struct cpumask *set = irq_default_affinity; |
285 | int ret; | 285 | int ret, node = desc->irq_data.node; |
286 | 286 | ||
287 | /* Excludes PER_CPU and NO_BALANCE interrupts */ | 287 | /* Excludes PER_CPU and NO_BALANCE interrupts */ |
288 | if (!irq_can_set_affinity(irq)) | 288 | if (!irq_can_set_affinity(irq)) |
@@ -301,6 +301,13 @@ setup_affinity(unsigned int irq, struct irq_desc *desc, struct cpumask *mask) | |||
301 | } | 301 | } |
302 | 302 | ||
303 | cpumask_and(mask, cpu_online_mask, set); | 303 | cpumask_and(mask, cpu_online_mask, set); |
304 | if (node != NUMA_NO_NODE) { | ||
305 | const struct cpumask *nodemask = cpumask_of_node(node); | ||
306 | |||
307 | /* make sure at least one of the cpus in nodemask is online */ | ||
308 | if (cpumask_intersects(mask, nodemask)) | ||
309 | cpumask_and(mask, mask, nodemask); | ||
310 | } | ||
304 | ret = chip->irq_set_affinity(&desc->irq_data, mask, false); | 311 | ret = chip->irq_set_affinity(&desc->irq_data, mask, false); |
305 | switch (ret) { | 312 | switch (ret) { |
306 | case IRQ_SET_MASK_OK: | 313 | case IRQ_SET_MASK_OK: |