]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
genirq/affinity: Remove cpus_read_lock() while reading cpu_possible_mask
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Wed, 1 Apr 2026 12:13:34 +0000 (14:13 +0200)
committerThomas Gleixner <tglx@kernel.org>
Wed, 1 Apr 2026 14:09:05 +0000 (16:09 +0200)
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 the CPU-hotplug lock while reading it.

Remove cpus_read_*() while accessing cpu_possible_mask.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260401121334.xeMOSC1v@linutronix.de
kernel/irq/affinity.c

index 85c45cfe72238ad211b3e2dcf59ae48fbbcfb091..78f2418a89252d37a80e6fcb11635c54974c751d 100644 (file)
@@ -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);
 }