Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1522478

[PATCH] irq/affinity: fix irq_create_affinity_masks for the pre_vectors case

From Christoph Hellwig <hch@lst.de>
Newsgroups linux.kernel
Subject [PATCH] irq/affinity: fix irq_create_affinity_masks for the pre_vectors case
Date 2016-11-15 10:20 +0100
Message-ID <sDI4i-30U-33@gated-at.bofh.it> (permalink)
References <sDI4h-30U-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Adjust the exit condition for assigning the affinity vectors to take the
pre_vectors into account.  Otherwise the last vector will get a cpu mask
for all CPUs by accidentally hitting the post_vectors case.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 kernel/irq/affinity.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c
index 17360bd..2ca420a 100644
--- a/kernel/irq/affinity.c
+++ b/kernel/irq/affinity.c
@@ -107,7 +107,9 @@ irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd)
 		/* Calculate the number of cpus per vector */
 		ncpus = cpumask_weight(nmsk);
 
-		for (v = 0; curvec < affv && v < vecs_to_assign; curvec++, v++) {
+		for (v = 0;
+		     curvec < affd->pre_vectors + affv && v < vecs_to_assign;
+		     curvec++, v++) {
 			cpus_per_vec = ncpus / vecs_to_assign;
 
 			/* Account for extra vectors to compensate rounding errors */
-- 
2.1.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

irq_create_affinity_masks fix Christoph Hellwig <hch@lst.de> - 2016-11-15 10:20 +0100
  [PATCH] irq/affinity: fix irq_create_affinity_masks for the pre_vectors case Christoph Hellwig <hch@lst.de> - 2016-11-15 10:20 +0100
    Re: [PATCH] irq/affinity: fix irq_create_affinity_masks for the  pre_vectors case Thomas Gleixner <tglx@linutronix.de> - 2016-11-15 23:50 +0100
      Re: [PATCH] irq/affinity: fix irq_create_affinity_masks for the         pre_vectors case Christoph Hellwig <hch@lst.de> - 2016-11-16 12:10 +0100
    [tip:irq/core] genirq/affinity: Take reserved vectors into account  when spreading irqs tip-bot for Christoph Hellwig <tipbot@zytor.com> - 2016-11-16 18:50 +0100

csiph-web