Skip to contentSkip to conversation

irq/affinity: Fix calculating vectors to assign

PATCH In review Keith Busch 3 participants 3 messages Apr 19, 2017 – Apr 22, 2017 IRQ

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 irq/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 3412386b531 ("irq/affinity: Fix extra vecs calculation")
---
 kernel/irq/affinity.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/irq/affinity.c +1 -1
index d052947..e2d356d 100644
@@ -98,7 +98,7 @@ irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd)
 		int ncpus, v, vecs_to_assign, vecs_per_node;
 
 		/* Spread the vectors per node */
-		vecs_per_node = (affv - curvec) / nodes;
+		vecs_per_node = (affv - (curvec - affd->pre_vectors)) / nodes;
 
 		/* Get the cpus on this node which are in the mask */
 		cpumask_and(nmsk, cpu_online_mask, cpumask_of_node(n));
Signature · 1 line
2.7.2
#1 lore raw

[tip:irq/urgent] genirq/affinity: Fix calculating vectors to assign

genirq/affinity: Fix calculating vectors to assign
Commit-ID:  b72f8051f34b8164a62391e3676edc34523c5952
Gitweb:     http://git.kernel.org/tip/b72f8051f34b8164a62391e3676edc34523c5952
Author:     Keith Busch <[email protected]>
AuthorDate: Wed, 19 Apr 2017 19:51:10 -0400
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Thu, 20 Apr 2017 16:03:09 +0200

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 3412386b531 ("irq/affinity: Fix extra vecs calculation")
---
 kernel/irq/affinity.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/irq/affinity.c +1 -1
index d052947..e2d356d 100644
@@ -98,7 +98,7 @@ irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd)
 		int ncpus, v, vecs_to_assign, vecs_per_node;
 
 		/* Spread the vectors per node */
-		vecs_per_node = (affv - curvec) / nodes;
+		vecs_per_node = (affv - (curvec - affd->pre_vectors)) / nodes;
 
 		/* Get the cpus on this node which are in the mask */
 		cpumask_and(nmsk, cpu_online_mask, cpumask_of_node(n));
#2 lore raw

Re: [tip:irq/urgent] genirq/affinity: Fix calculating vectors to assign

Looks like 4.11 will be release in a few days, it would be nice if this commit reaches the upstream tree before this moment.

Thanks.

Quoted 37 lines · tip-bot for Keith Busch
Commit-ID:  b72f8051f34b8164a62391e3676edc34523c5952
Gitweb:     http://git.kernel.org/tip/b72f8051f34b8164a62391e3676edc34523c5952
Author:     Keith Busch <[email protected]>
AuthorDate: Wed, 19 Apr 2017 19:51:10 -0400
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Thu, 20 Apr 2017 16:03:09 +0200

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 3412386b531 ("irq/affinity: Fix extra vecs calculation")
---
 kernel/irq/affinity.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/irq/affinity.c +1 -1
index d052947..e2d356d 100644
@@ -98,7 +98,7 @@ irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd)
 		int ncpus, v, vecs_to_assign, vecs_per_node;
 
 		/* Spread the vectors per node */
-		vecs_per_node = (affv - curvec) / nodes;
+		vecs_per_node = (affv - (curvec - affd->pre_vectors)) / nodes;
 
 		/* Get the cpus on this node which are in the mask */
 		cpumask_and(nmsk, cpu_online_mask, cpumask_of_node(n));