Skip to content
Commit cd7f5535 authored by Yury Norov's avatar Yury Norov Committed by Jakub Kicinski
Browse files

sched: add sched_numa_find_nth_cpu()



The function finds Nth set CPU in a given cpumask starting from a given
node.

Leveraging the fact that each hop in sched_domains_numa_masks includes the
same or greater number of CPUs than the previous one, we can use binary
search on hops instead of linear walk, which makes the overall complexity
of O(log n) in terms of number of cpumask_weight() calls.

Signed-off-by: default avatarYury Norov <yury.norov@gmail.com>
Acked-by: default avatarTariq Toukan <tariqt@nvidia.com>
Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Reviewed-by: default avatarPeter Lafreniere <peter@n8pjl.ca>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 62f4386e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment