From nobody Wed Apr 1 20:42:56 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CEED53D1CCC for ; Wed, 1 Apr 2026 12:13:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775045619; cv=none; b=KBZspplZEWT+HIEO7hkbFsuegKOtqJiziEAPDUnQa+1UupcEfY9Fu8nw8MUDQyW/utL9Qzpv04EKpWv6E2n9EtnjRCLJno554hQGQsUBO/sFCAmZMDhLm6DafrCtF4SRkvRIxDf12dJrld1iZk1xGVEiPWNc4qR2u/xMyunP0mo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775045619; c=relaxed/simple; bh=IoIdu6PnPwikey0TtfuWbQy4Xl7+5JWdObjp3mE/E7E=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=SpSTYBttpzF5Dz107wEyoT0hC2lTXB4+mJlyZy5LMQeM9mqJE8lLYwUwrV1H3a9h7VYzbdl7z80dBpLA3p7/E8NbQ5s30uFOgG5pLe0rbR93Iq0QsFu6fEBVhEpfM9StRrTffBJZYPex9RzBQF739F2L4gXvIKQFmLT0FKf+720= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Zw/h9MxB; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=gIAQluAO; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Zw/h9MxB"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="gIAQluAO" Date: Wed, 1 Apr 2026 14:13:34 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1775045616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=Y6+x75wK82zkc3ek/3C3XxN50puihlWYCk5T9vCWeWk=; b=Zw/h9MxBo5GgH2OIjMpDPkCKl6+YYOUEGKqayMIp+5Nl4py6elf8B6c0FtN2fxDvxpHZTu WD9nL9p9IW3Pmn1HwAxk5VpKl6ruV1c6aAjo4CY/tZdCpTrVMiqNdBWy9m+ChgOhNO95oa dGCnyp9aPYkZS2hNZk5jt83RP4mrvNdukx1f2SX/p090M/OP5AWi07kyOVex1rI+LnITy3 3ctFpNItGMmg4b8q6umvIiPvc+J4li+FesYbkJy+z+baHypt5PtgDnsaBnhVLddcrs5GRV Zq/DLQkrkxfjHSn1vJVs0vLnQzHcnwsU3FiqrUCGnAYFipSBFaiHo2pBZYWbsA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1775045616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=Y6+x75wK82zkc3ek/3C3XxN50puihlWYCk5T9vCWeWk=; b=gIAQluAOLBTi0NDMA5eauEIZa4rl81m6brJpl6ynCvo76NPE7Fm6qTY0wlzLkC2Lyb3p18 tPbQaIzE8CmdCZDg== From: Sebastian Andrzej Siewior To: linux-kernel@vger.kernel.org Cc: Thomas Gleixner , Aaron Tomlin Subject: [PATCH] genirq/affinity: Remove cpus_read_lock() while reading cpu_possible_mask Message-ID: <20260401121334.xeMOSC1v@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 --- 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 m= invec, unsigned int maxvec, if (resv > minvec) return 0; =20 - if (affd->calc_sets) { + if (affd->calc_sets) set_vecs =3D maxvec - resv; - } else { - cpus_read_lock(); + else set_vecs =3D cpumask_weight(cpu_possible_mask); - cpus_read_unlock(); - } =20 return resv + min(set_vecs, maxvec - resv); } --=20 2.53.0