Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp292677pxb; Tue, 12 Apr 2022 02:00:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfEte0688TU1XtR7BaRkUighwkgEmxRmpEmPQeHDvTg/Bue+wLSIjxC3Sfus0kbM2/+sg3 X-Received: by 2002:a17:906:c103:b0:6e0:df50:7f52 with SMTP id do3-20020a170906c10300b006e0df507f52mr34467429ejc.501.1649754047481; Tue, 12 Apr 2022 02:00:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649754047; cv=none; d=google.com; s=arc-20160816; b=anDP30PRb6fbx30Pd/DeIa0a+5C04Te+120AtzQI0A1Z75hd/TgNa9SHzI/+wcCIcK JzT6Q3/5xK6Q/DUkIsFtt/NeKaKjg2wN2329Sfa/7jL3uS9DWX1qbRRqOSkvLHB8NBXF RqnPQS4959hEF1N4RrKo/fcVxg34Q/glBL6OHxSButDHb7SmltIkWuNet9CqoI5LEbgl TpxVOQTj7wTUC0tkAGrggT6W3TRy2z/2OajTDCkwKmf7D0SsmRsY2umfH0tFYHNNUJiR Izf3/iwDFUbp+j1HBUleK797zrfYjuiG72HF2WpmW+k6rDHh6NlnAYPfz9tPvqL+m6jX Ezdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=8Q/cLzqt8hbPDP/r8Xme0RmnOVKky9waF1u0fTBQPW8=; b=KgIFykUczE4ByvDz2Q7EaixIUU9Pvu2aFuWd9SQdfciuP2X5ujqnGH3k58zJHPlmmx xb3tJHBWnNYYCMwjSYzKb0hmTS15n7kwRHt4CuIft7NdsqttF69I85BFZr7WqMr2HZ35 ZO78iLeccGqPr3W27myBlG3ozjk4WT5HmSaeIw5sKLNpmAcHwwqNWJZcbknwNHVgX8f4 vEbJz6IJlTN8j00ctU1bMO/P3a9QGpRs3fRia6lsyBbQBiRkbpsM3bbl0CbgfW9o5AKd JXs/d1WVHfICG1U2d0hB7hTuoKq6C7MoNHQEvES+B8wQrOd8o0b0yGJZi59WwTH4ve/y cS7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=x52nZXb3; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e15-20020a170906248f00b006dfd28d349csi49108ejb.119.2022.04.12.02.00.17; Tue, 12 Apr 2022 02:00:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=x52nZXb3; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343565AbiDKILY (ORCPT + 99 others); Mon, 11 Apr 2022 04:11:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235172AbiDKILU (ORCPT ); Mon, 11 Apr 2022 04:11:20 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0556C3; Mon, 11 Apr 2022 01:09:06 -0700 (PDT) Date: Mon, 11 Apr 2022 08:09:03 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1649664544; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8Q/cLzqt8hbPDP/r8Xme0RmnOVKky9waF1u0fTBQPW8=; b=x52nZXb3Ti/QiUJVh16HQD0PYbZ/YoqbEg5M1SfYYvtWMra+3PNmAasov5wi3oO0OtA6dk 026m9NxidHxiJpojzboh3cKUHihq2daZxFBQYJyYQc+pyGQNFjlW6XNPQQSlOX1vMA1zpW xTKYCEE3uAVhysK/7gwEr0WI4V+yqekKCUbvy7Qr1s4rNZ5jHeAo5qSgFTnNx0odO94eBa QhcS0m/kh0iy1PTQ2G4IDl1RIx3Tay+AOIFL+mOndDhiGyjjMf3bwdz70kS2LnKEuYB8yz SnsFHw0cQmkRSkH2kWJzgkcPjwmAHVINlnpaFnqrdRmw3Yl+oHY9IeaztCNPWQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1649664544; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8Q/cLzqt8hbPDP/r8Xme0RmnOVKky9waF1u0fTBQPW8=; b=XCIKjdzpMmMgtZQLO6q2CLTsAEaouqCM43Lizmbcl7cI60y445sXG7BFs0nIqgGFIumOHQ f7AUnIMr5KDxtwCg== From: "tip-bot2 for Rei Yamamoto" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/urgent] genirq/affinity: Consider that CPUs on nodes can be unbalanced Cc: Rei Yamamoto , Thomas Gleixner , Ming Lei , stable@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org In-Reply-To: <20220331003309.10891-1-yamamoto.rei@jp.fujitsu.com> References: <20220331003309.10891-1-yamamoto.rei@jp.fujitsu.com> MIME-Version: 1.0 Message-ID: <164966454348.4207.142052541335966473.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 The following commit has been merged into the irq/urgent branch of tip: Commit-ID: 08d835dff916bfe8f45acc7b92c7af6c4081c8a7 Gitweb: https://git.kernel.org/tip/08d835dff916bfe8f45acc7b92c7af6c4081c8a7 Author: Rei Yamamoto AuthorDate: Thu, 31 Mar 2022 09:33:09 +09:00 Committer: Thomas Gleixner CommitterDate: Mon, 11 Apr 2022 09:58:03 +02:00 genirq/affinity: Consider that CPUs on nodes can be unbalanced If CPUs on a node are offline at boot time, the number of nodes is different when building affinity masks for present cpus and when building affinity masks for possible cpus. This causes the following problem: In the case that the number of vectors is less than the number of nodes there are cases where bits of masks for present cpus are overwritten when building masks for possible cpus. Fix this by excluding CPUs, which are not part of the current build mask (present/possible). [ tglx: Massaged changelog and added comment ] Fixes: b82592199032 ("genirq/affinity: Spread IRQs to all available NUMA nodes") Signed-off-by: Rei Yamamoto Signed-off-by: Thomas Gleixner Reviewed-by: Ming Lei Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220331003309.10891-1-yamamoto.rei@jp.fujitsu.com --- kernel/irq/affinity.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c index f7ff891..fdf1704 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_or(&masks[curvec].mask, &masks[curvec].mask, - node_to_cpumask[n]); + /* Ensure that only CPUs which are in both masks are set */ + cpumask_and(nmsk, cpu_mask, node_to_cpumask[n]); + cpumask_or(&masks[curvec].mask, &masks[curvec].mask, nmsk); if (++curvec == last_affv) curvec = firstvec; }