Skip to content

Commit b72f805

Browse files
Keith BuschKAGA-KOKO
authored andcommitted
genirq/affinity: Fix calculating vectors to assign
The vectors_per_node is calculated from the remaining available vectors. The current vector starts after pre_vectors, so we need to subtract that from the current to properly account for the number of remaining vectors to assign. Fixes: 3412386 ("irq/affinity: Fix extra vecs calculation") Reported-by: Andrei Vagin <[email protected]> Signed-off-by: Keith Busch <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
1 parent f61143c commit b72f805

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/irq/affinity.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd)
9898
int ncpus, v, vecs_to_assign, vecs_per_node;
9999

100100
/* Spread the vectors per node */
101-
vecs_per_node = (affv - curvec) / nodes;
101+
vecs_per_node = (affv - (curvec - affd->pre_vectors)) / nodes;
102102

103103
/* Get the cpus on this node which are in the mask */
104104
cpumask_and(nmsk, cpu_online_mask, cpumask_of_node(n));

0 commit comments

Comments
 (0)