Commit 34d85ad4 authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Thomas Gleixner
Browse files

genirq/affinity: Remove cpus_read_lock() while reading cpu_possible_mask



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: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarThomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260401121334.xeMOSC1v@linutronix.de
parent 56c167a0
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -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);
}