Skip to content

Commit

Permalink
lib/cpumask: update comment to cpumask_local_spread()
Browse files Browse the repository at this point in the history
Now that we have a for_each_numa_online_cpu(), which is a more
straightforward replacement to the cpumask_local_spread() when it comes to
enumeration of CPUs with respect to NUMA topology, it's worth to update the
comment.

Signed-off-by: Yury Norov <yury.norov@gmail.com>
  • Loading branch information
Yury Norov committed Jul 18, 2023
1 parent a4be5fa commit 57ddcc0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/cpumask.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,8 @@ void __init free_bootmem_cpumask_var(cpumask_var_t mask)
*
* There's a better alternative based on for_each()-like iterators:
*
* for_each_numa_hop_mask(mask, node) {
* for_each_cpu_andnot(cpu, mask, prev)
* do_something(cpu);
* prev = mask;
* }
* for_each_numa_online_cpu(cpu, hop, node)
* do_something(cpu);
*
* It's simpler and more verbose than above. Complexity of iterator-based
* enumeration is O(sched_domains_numa_levels * nr_cpu_ids), while
Expand Down

0 comments on commit 57ddcc0

Please sign in to comment.