sched/topology: Fix sched_numa_find_nth_cpu() in non-NUMA case
authorYury Norov <yury.norov@gmail.com>
Sat, 19 Aug 2023 14:12:36 +0000 (07:12 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:58:51 +0000 (11:58 +0100)
commit03a34cb072fc3a4976e07fc1a79790adc079611e
tree91e40d7fb2d0d008444dde167061976b372ce60e
parentb633c05136544aff3e06c1a93d65e6c15f77ac1a
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>
include/linux/topology.h