From nobody Fri Jun 19 18:19:05 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CD98C433EF for ; Thu, 31 Mar 2022 00:54:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352189AbiCaA4Y (ORCPT ); Wed, 30 Mar 2022 20:56:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352181AbiCaA4W (ORCPT ); Wed, 30 Mar 2022 20:56:22 -0400 X-Greylist: delayed 64 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 30 Mar 2022 17:54:35 PDT Received: from esa3.hc1455-7.c3s2.iphmx.com (esa3.hc1455-7.c3s2.iphmx.com [207.54.90.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF7B02F38F for ; Wed, 30 Mar 2022 17:54:35 -0700 (PDT) X-IronPort-AV: E=McAfee;i="6200,9189,10302"; a="68063399" X-IronPort-AV: E=Sophos;i="5.90,223,1643641200"; d="scan'208";a="68063399" Received: from unknown (HELO yto-r1.gw.nic.fujitsu.com) ([218.44.52.217]) by esa3.hc1455-7.c3s2.iphmx.com with ESMTP; 31 Mar 2022 09:53:30 +0900 Received: from yto-m2.gw.nic.fujitsu.com (yto-nat-yto-m2.gw.nic.fujitsu.com [192.168.83.65]) by yto-r1.gw.nic.fujitsu.com (Postfix) with ESMTP id 764F9E062B for ; Thu, 31 Mar 2022 09:53:28 +0900 (JST) Received: from m3004.s.css.fujitsu.com (m3004.s.css.fujitsu.com [10.128.233.124]) by yto-m2.gw.nic.fujitsu.com (Postfix) with ESMTP id BF29AE6C0E for ; Thu, 31 Mar 2022 09:53:26 +0900 (JST) Received: from localhost.localdomain (unknown [10.125.5.220]) by m3004.s.css.fujitsu.com (Postfix) with ESMTP id 9988B2041DE8; Thu, 31 Mar 2022 09:53:26 +0900 (JST) From: Rei Yamamoto To: tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, ming.lei@redhat.com, yamamoto.rei@jp.fujitsu.com Subject: [PATCH v4] irq: consider cpus on nodes are unbalanced Date: Thu, 31 Mar 2022 09:33:09 +0900 Message-Id: <20220331003309.10891-1-yamamoto.rei@jp.fujitsu.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" If cpus on a node are offline at boot time, there are difference in the number of nodes between when building affinity masks for present cpus and when building affinity masks for possible cpus. This patch fixes a problem caused by the difference of the number of nodes: - The routine of "numvecs <=3D nodes" condition can overwrite bits of masks for present cpus in building masks for possible cpus. Fix this problem by making CPU bits, which is not target, not changing. Signed-off-by: Rei Yamamoto Reviewed-by: Ming Lei --- kernel/irq/affinity.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c index f7ff8919dc9b..d2d01565d2ec 100644 --- a/kernel/irq/affinity.c +++ b/kernel/irq/affinity.c @@ -269,8 +269,9 @@ static int __irq_build_affinity_masks(unsigned int star= tvec, */ if (numvecs <=3D nodes) { for_each_node_mask(n, nodemsk) { + cpumask_and(nmsk, cpu_mask, node_to_cpumask[n]); cpumask_or(&masks[curvec].mask, &masks[curvec].mask, - node_to_cpumask[n]); + nmsk); if (++curvec =3D=3D last_affv) curvec =3D firstvec; } --=20 2.27.0