lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20201224042313.733960-1-liuchao173@huawei.com>
Date:   Thu, 24 Dec 2020 12:23:13 +0800
From:   Liu Chao <liuchao173@...wei.com>
To:     <tglx@...utronix.de>, <linux-kernel@...r.kernel.org>
CC:     <hushiyuan@...wei.com>, <hewenliang4@...wei.com>
Subject: [PATCH] genirq: Limit irq_calc_affinity_vectors to housekeeping CPUs

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@...wei.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ