[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1479201178-29604-2-git-send-email-hch@lst.de>
Date: Tue, 15 Nov 2016 10:12:58 +0100
From: Christoph Hellwig <hch@....de>
To: tglx@...utronix.de
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH] irq/affinity: fix irq_create_affinity_masks for the pre_vectors case
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@....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
Powered by blists - more mailing lists