From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: linux-kernel@vger.kernel.org
Cc: Thomas Gleixner <tglx@kernel.org>, Aaron Tomlin <atomlin@atomlin.com>
Subject: [PATCH] genirq/affinity: Remove cpus_read_lock() while reading cpu_possible_mask
Date: Wed, 1 Apr 2026 14:13:34 +0200 [thread overview]
Message-ID: <20260401121334.xeMOSC1v@linutronix.de> (raw)
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
next reply other threads:[~2026-04-01 12:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-01 12:13 Sebastian Andrzej Siewior [this message]
2026-04-01 14:15 ` [tip: irq/core] genirq/affinity: Remove cpus_read_lock() while reading cpu_possible_mask tip-bot2 for Sebastian Andrzej Siewior
2026-04-03 0:26 ` [PATCH] " Aaron Tomlin
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=20260401121334.xeMOSC1v@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=atomlin@atomlin.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@kernel.org \
/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