Received: by 2002:a05:6512:2355:0:0:0:0 with SMTP id p21csp214455lfu; Wed, 30 Mar 2022 21:19:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysLCe8ygHzuwGiy5APH+KaU0oanDz1RFS/eo1oAaweLoxYv0rPJCL+d1Vqz5Y8HFUp+HqE X-Received: by 2002:a17:90b:1642:b0:1c6:c6d0:fbfa with SMTP id il2-20020a17090b164200b001c6c6d0fbfamr3780526pjb.218.1648700349829; Wed, 30 Mar 2022 21:19:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648700349; cv=none; d=google.com; s=arc-20160816; b=O0AxX2jJpzhCtzVqicnkfu9KBPjKIPgIi8/lyI5INQud/rj4EN+oXjK618h7eZUUGC AvdS9VAgM2z5xYlFVlh+CT8X5+I+jDzODzdwpF5PYUI5SHd0A6w+fgTtDqhqLLmy1oJk OLY5uO70ullfEmWnvQ53vEbkQ6e+4J83NaWGcoKi/0uUdX6hclr1U5XVl4Pq6AZRoolM 52fImUkhnzKCZtDTFO57s/Fye/An/zICAykl8l6pUfx1mc6dcqvU+uW4NOfGa6N3fWl6 qsFyE1TwWGieN9DE0Q00+8b3ju89FJXIeEj/Oii0C2V/RkMywwq1pr2Ko/9oUAUwxQgp TK4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=XuBLIZ/uyquaAPJ5evQwsd/k40c3ANd/J53oqxS1Pf4=; b=TpF+7N/f3XSbu/TqnmnCkGalR98nruA8rrpgTJ3Q13c0/M/JHukFx/A+Prd5rrn/5l DRhIv4xp/FD9sXmcap86CDnOYOmn198mteamuEtC6foHkzusDSOSTJauzERiyFbdo/xP p1EPvUcR1H6UR0FEmps72VAH2LUZXHQjIarCZTBQ9pYsuae32+bKcfiO5Mf4BkFCx4Ry o8F91M1CBjxxE9NpTwlieIdfe7M2mFXT5TA3N7TGt8/oygI52kKKMIHVvf0moBFPf+Cz IuJUD038/QskMp1g/pPg8Vgi7fkJnNwxUiIwRGg22UH2T2RoIwRGGG4F697JfW4bxMmX VNBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id s2-20020a63e802000000b003820b4f8361si20717674pgh.182.2022.03.30.21.19.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 21:19:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 334E017A2FB; Wed, 30 Mar 2022 20:14:28 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352184AbiCaA4Y (ORCPT + 99 others); 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: 8bit X-TM-AS-GCONF: 00 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 <= 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 startvec, */ if (numvecs <= 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 == last_affv) curvec = firstvec; } -- 2.27.0