Skip to content

Commit b825921

Browse files
longlimsftKAGA-KOKO
authored andcommitted
genirq/affinity: Spread IRQs to all available NUMA nodes
If the number of NUMA nodes exceeds the number of MSI/MSI-X interrupts which are allocated for a device, the interrupt affinity spreading code fails to spread them across all nodes. The reason is, that the spreading code starts from node 0 and continues up to the number of interrupts requested for allocation. This leaves the nodes past the last interrupt unused. This results in interrupt concentration on the first nodes which violates the assumption of the block layer that all nodes are covered evenly. As a consequence the NUMA nodes above the number of interrupts are all assigned to hardware queue 0 and therefore NUMA node 0, which results in bad performance and has CPU hotplug implications, because queue 0 gets shut down when the last CPU of node 0 is offlined. Go over all NUMA nodes and assign them round-robin to all requested interrupts to solve this. [ tglx: Massaged changelog ] Signed-off-by: Long Li <longli@microsoft.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Ming Lei <ming.lei@redhat.com> Cc: Michael Kelley <mikelley@microsoft.com> Link: https://lkml.kernel.org/r/20181102180248.13583-1-longli@linuxonhyperv.com
1 parent 6510223 commit b825921

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

kernel/irq/affinity.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,11 @@ static int irq_build_affinity_masks(const struct irq_affinity *affd,
117117
*/
118118
if (numvecs <= nodes) {
119119
for_each_node_mask(n, nodemsk) {
120-
cpumask_copy(masks + curvec, node_to_cpumask[n]);
121-
if (++done == numvecs)
122-
break;
120+
cpumask_or(masks + curvec, masks + curvec, node_to_cpumask[n]);
123121
if (++curvec == last_affv)
124122
curvec = affd->pre_vectors;
125123
}
124+
done = numvecs;
126125
goto out;
127126
}
128127

0 commit comments

Comments
 (0)