From mboxrd@z Thu Jan 1 00:00:00 1970 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 828A7C2BB3F for ; Wed, 15 Nov 2023 19:32:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234094AbjKOTcV (ORCPT ); Wed, 15 Nov 2023 14:32:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234141AbjKOTcD (ORCPT ); Wed, 15 Nov 2023 14:32:03 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CBC11B9 for ; Wed, 15 Nov 2023 11:31:59 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3483AC433C9; Wed, 15 Nov 2023 19:31:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1700076719; bh=xzYDLOre1aBVogJc1v1s63FGmUlv7+M2j/UgiRob7D8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xTa0zjqmjJJyyMrVlVWVhADNvfUoTZxzg0GzUaD8iU68To8s34jsiaBGKRF8VyF7V hUil3+Ol/P+lHro6/hc70uNIWeTQaLn3OVMsmUaIwVJjKd+egY+6QTIlJvz1NX+RQH bBANMNwUR6FgJA4K0fBPkeNxk97/SDnRDh884F3o= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yury Norov , Ingo Molnar , Mel Gorman , Sasha Levin Subject: [PATCH 6.6 004/603] sched/topology: Fix sched_numa_find_nth_cpu() in non-NUMA case Date: Wed, 15 Nov 2023 14:09:09 -0500 Message-ID: <20231115191613.425390619@linuxfoundation.org> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231115191613.097702445@linuxfoundation.org> References: <20231115191613.097702445@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yury Norov [ Upstream commit 8ab63d418d4339d996f80d02a00dbce0aa3ff972 ] 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 Signed-off-by: Sasha Levin --- 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 fea32377f7c77..52f5850730b3e 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 * -- 2.42.0