summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorYury Norov <yury.norov@gmail.com>2023-08-19 07:12:36 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-11-20 11:56:42 +0100
commit107688f52ae3fe382640442578fdb021d94a63cc (patch)
tree34fd903af4ddad3abd1ebe8d4438761fa41d9409 /include
parente213ce7956cd09e22f8f2b3d1edf803dc06911f3 (diff)
downloadlinux-stable-107688f52ae3fe382640442578fdb021d94a63cc.tar.gz
linux-stable-107688f52ae3fe382640442578fdb021d94a63cc.tar.bz2
linux-stable-107688f52ae3fe382640442578fdb021d94a63cc.zip
sched/topology: Fix sched_numa_find_nth_cpu() in non-NUMA case
[ 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 <yury.norov@gmail.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: Mel Gorman <mgorman@suse.de> Link: https://lore.kernel.org/r/20230819141239.287290-5-yury.norov@gmail.com Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/topology.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/topology.h b/include/linux/topology.h
index fea32377f7c7..52f5850730b3 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 *