From: Christoph Hellwig <hch@lst.de>
To: tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] irq/affinity: fix irq_create_affinity_masks for the pre_vectors case
Date: Tue, 15 Nov 2016 10:12:58 +0100 [thread overview]
Message-ID: <1479201178-29604-2-git-send-email-hch@lst.de> (raw)
In-Reply-To: <1479201178-29604-1-git-send-email-hch@lst.de>
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
next prev parent reply other threads:[~2016-11-15 9:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-15 9:12 irq_create_affinity_masks fix Christoph Hellwig
2016-11-15 9:12 ` Christoph Hellwig [this message]
2016-11-15 22:41 ` [PATCH] irq/affinity: fix irq_create_affinity_masks for the pre_vectors case Thomas Gleixner
2016-11-16 11:04 ` Christoph Hellwig
2016-11-16 17:48 ` [tip:irq/core] genirq/affinity: Take reserved vectors into account when spreading irqs tip-bot for Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1479201178-29604-2-git-send-email-hch@lst.de \
--to=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®