From: Liu Chao <liuchao173@huawei.com>
To: <tglx@linutronix.de>, <linux-kernel@vger.kernel.org>
Cc: <hushiyuan@huawei.com>, <hewenliang4@huawei.com>
Subject: [PATCH] genirq: Limit irq_calc_affinity_vectors to housekeeping CPUs
Date: Thu, 24 Dec 2020 12:23:13 +0800 [thread overview]
Message-ID: <20201224042313.733960-1-liuchao173@huawei.com> (raw)
Replace the cpumask used in irq_calc_affinity_vectors from all possible
CPUs to only housekeeping CPUs.
When we have isolated CPUs used by real-time tasks, IRQs will be move to
housekeeping CPUs.
If there are too many IRQ vectors, moving the all to housekeeping CPUs may
exceed per-CPU vector limits. For example, when I only have two
housekeeping CPUs, there are dozens of IRQs on two CPUs, but actually one
IRQ per housekeeping CPU is enough.
Signed-off-by: Liu Chao <liuchao173@huawei.com>
---
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 4d89ad4fae3b..3f22e3314e1b 100644
--- a/kernel/irq/affinity.c
+++ b/kernel/irq/affinity.c
@@ -8,6 +8,7 @@
#include <linux/slab.h>
#include <linux/cpu.h>
#include <linux/sort.h>
+#include <linux/sched/isolation.h>
static void irq_spread_init_one(struct cpumask *irqmsk, struct cpumask *nmsk,
unsigned int cpus_per_vec)
@@ -506,7 +507,8 @@ unsigned int irq_calc_affinity_vectors(unsigned int minvec, unsigned int maxvec,
set_vecs = maxvec - resv;
} else {
get_online_cpus();
- set_vecs = cpumask_weight(cpu_possible_mask);
+ set_vecs = cpumask_weight(
+ housekeeping_cpumask(HK_FLAG_MANAGED_IRQ));
put_online_cpus();
}
--
2.23.0
next reply other threads:[~2020-12-24 4:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-24 4:23 Liu Chao [this message]
2021-01-22 8:47 Liu Chao
2021-01-28 0:06 ` Thomas Gleixner
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=20201224042313.733960-1-liuchao173@huawei.com \
--to=liuchao173@huawei.com \
--cc=hewenliang4@huawei.com \
--cc=hushiyuan@huawei.com \
--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®