public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] genirq/affinity: Remove cpus_read_lock() while reading cpu_possible_mask
@ 2026-04-01 12:13 Sebastian Andrzej Siewior
  2026-04-01 14:15 ` [tip: irq/core] " tip-bot2 for Sebastian Andrzej Siewior
  2026-04-03  0:26 ` [PATCH] " Aaron Tomlin
  0 siblings, 2 replies; 3+ messages in thread
From: Sebastian Andrzej Siewior @ 2026-04-01 12:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Thomas Gleixner, Aaron Tomlin

cpu_possible_mask is set early during boot based on information from the
firmware. After that it remains read only and is never changed.
Therefore there is no need to acquire CPU-hotplug locks while reading
it.

Remove cpus_read_*() while accessing cpu_possible_mask.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 kernel/irq/affinity.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c
index 85c45cfe72238..78f2418a89252 100644
--- a/kernel/irq/affinity.c
+++ b/kernel/irq/affinity.c
@@ -115,13 +115,10 @@ unsigned int irq_calc_affinity_vectors(unsigned int minvec, unsigned int maxvec,
 	if (resv > minvec)
 		return 0;
 
-	if (affd->calc_sets) {
+	if (affd->calc_sets)
 		set_vecs = maxvec - resv;
-	} else {
-		cpus_read_lock();
+	else
 		set_vecs = cpumask_weight(cpu_possible_mask);
-		cpus_read_unlock();
-	}
 
 	return resv + min(set_vecs, maxvec - resv);
 }
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-03  0:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-01 12:13 [PATCH] genirq/affinity: Remove cpus_read_lock() while reading cpu_possible_mask Sebastian Andrzej Siewior
2026-04-01 14:15 ` [tip: irq/core] " tip-bot2 for Sebastian Andrzej Siewior
2026-04-03  0:26 ` [PATCH] " Aaron Tomlin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox