From patchwork Fri Sep 15 12:03:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 140596 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp1229730vqi; Fri, 15 Sep 2023 11:05:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGL5fys/7EpTGRvt9C6FQRNSIw77Z+ohH3+CynR58haY3WFjixtiev1UWgpw4bB7HK6MXkg X-Received: by 2002:a17:902:da8c:b0:1c4:4a4d:cda with SMTP id j12-20020a170902da8c00b001c44a4d0cdamr665970plx.15.1694801154869; Fri, 15 Sep 2023 11:05:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694801154; cv=none; d=google.com; s=arc-20160816; b=YMEfPGahwZHI22eZ+OMCsWj+4KVI5TNM6VzYbI2gbafvFeu/LoxamTXk/H8ppfnJzV yKs2nGDgiaarCvRNIKgocLHKNsCenphN7zeMVAAaDlJslb/INm5Jcq5xYfX/MKbIrKGr v7LRT1nyAC1vPsygKucijph5FfDWO4I0TPTGFecEVUGdjlZA+YTvW82tr8vhs+tjEE/l dgh4Qr/KrgRUAA/qrhriUnZkEGwRMvDX71L5crRETddi01mQhpR/gYCslAV/sK8blCw+ l3NJVKsYkaRYmn+X3IyCuEkULGm3zPdOAqDPJMxQL4Sotp5qPrHPc0I0N8swCfUUK7gn WBkA== 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=Knz92vbi3xQjwBg4Oo4g/J44FErfuk1HmZsD73zqmVE=; fh=eKeIeQq6ZJEPpCVRKsN4VFa+FaRfE4kjc161Ip6RZyg=; b=noOE2lJ+uiZ0ulzPYIEn4ViEnOFNgIzgOzU5Btcc86F6JQLuK1g/tiksp0uJwH7z/a W+MEjghbbfAEyevtKcl649rEW3++H47GTqPR3C+7NGTiSdVUw1DfLo1sdBX9iQHNE1W5 I+2t3VRiHPu9ktuOxuve3pWcrjHgjWRyc0lswZtRFve3Y8dhfDnyM5x8w4MDcPJkV5+e YsECNSL+xkEqzcUA/xtojzR7VaKVkbjdO+huLMsdt9pMaMPi3WWZyYtZJMnKTpygJsZi l5q2ob8VRxfXW6/tkRACBnHFvsgCJRiGqzf3L2CpIw6ZeGVAiI1kC8M++3KHc56DTXXz syTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=QLVAjCrt; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id le13-20020a170902fb0d00b001c3323ff53asi3648286plb.139.2023.09.15.11.05.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 11:05:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=QLVAjCrt; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id CF7E081DDE7D; Fri, 15 Sep 2023 05:05:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234444AbjIOMFu (ORCPT + 32 others); Fri, 15 Sep 2023 08:05:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232836AbjIOMFs (ORCPT ); Fri, 15 Sep 2023 08:05:48 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE86630FC; Fri, 15 Sep 2023 05:03:29 -0700 (PDT) Date: Fri, 15 Sep 2023 12:03:27 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1694779408; 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=Knz92vbi3xQjwBg4Oo4g/J44FErfuk1HmZsD73zqmVE=; b=QLVAjCrtfjXvQuu09jprgAhNAGUafer6iu6XvAEgwPxZHI2TPYubDxU8X9EfO/hI2xvOrf wOUB12JQGqa6VYQVrh2K36ofmeT1xjDe6jEzMX/mRnjHuEA97ySAYoY066Qy9/QWB4TX4j YLCRllwRnt+H0c8Dq7FQtsMofyLhsmPuNzQnTrprT/Pbmo9BN1v3ZVegDq/VNqdrY2i0IO I9FpBsScmUFdi/pfx585aegBs9tLl57T5EhC4+mooqybOgi3o+PdbtBoJNEXVdVPFwDUmM cWop7Z/hUtQWqMUoxTvVlFGIoA7lxzoZ4V3bBJELEBYuDGT+eYb0WkoCkfZqrg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1694779408; 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=Knz92vbi3xQjwBg4Oo4g/J44FErfuk1HmZsD73zqmVE=; b=qFrzo0I/hWBhFAz8CNGa2/ZnOUm3o58+c6Lhd08KY0qGQ2eBgwqEPPi/Z+JFhhyjgbN4M3 Fj2tGu6kkyNV06Bw== From: "tip-bot2 for Yury Norov" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched/topology: Fix sched_numa_find_nth_cpu() in non-NUMA case Cc: Yury Norov , Ingo Molnar , Mel Gorman , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230819141239.287290-5-yury.norov@gmail.com> References: <20230819141239.287290-5-yury.norov@gmail.com> MIME-Version: 1.0 Message-ID: <169477940797.27769.5804988700503210268.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 15 Sep 2023 05:05:57 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777127815702554150 X-GMAIL-MSGID: 1777127815702554150 The following commit has been merged into the sched/core branch of tip: Commit-ID: 8ab63d418d4339d996f80d02a00dbce0aa3ff972 Gitweb: https://git.kernel.org/tip/8ab63d418d4339d996f80d02a00dbce0aa3ff972 Author: Yury Norov AuthorDate: Sat, 19 Aug 2023 07:12:36 -07:00 Committer: Ingo Molnar CommitterDate: Fri, 15 Sep 2023 13:48:10 +02:00 sched/topology: Fix sched_numa_find_nth_cpu() in non-NUMA case When CONFIG_NUMA is enabled, sched_numa_find_nth_cpu() searches for a CPU in sched_domains_numa_masks. The masks includes only online CPUs, so effectively offline CPUs are skipped. When CONFIG_NUMA is disabled, the fallback function should be consistent. Fixes: cd7f55359c90 ("sched: add sched_numa_find_nth_cpu()") Signed-off-by: Yury Norov Signed-off-by: Ingo Molnar Cc: Mel Gorman Link: https://lore.kernel.org/r/20230819141239.287290-5-yury.norov@gmail.com --- include/linux/topology.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/topology.h b/include/linux/topology.h index fea3237..52f5850 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h @@ -251,7 +251,7 @@ extern const struct cpumask *sched_numa_hop_mask(unsigned int node, unsigned int #else static __always_inline int sched_numa_find_nth_cpu(const struct cpumask *cpus, int cpu, int node) { - return cpumask_nth(cpu, cpus); + return cpumask_nth_and(cpu, cpus, cpu_online_mask); } static inline const struct cpumask *