diff mbox series

[4/4] lib/cpumask: don't mention for_each_numa_hop_mask in cpumask_local_spread()"

Message ID 20230925020528.777578-5-yury.norov@gmail.com (mailing list archive)
State Not Applicable
Headers show
Series sched: drop for_each_numa_hop_mask() | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1342 this patch: 1342
netdev/cc_maintainers fail 2 maintainers not CCed: linux@rasmusvillemoes.dk andriy.shevchenko@linux.intel.com
netdev/build_clang success Errors and warnings before: 1364 this patch: 1364
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1365 this patch: 1365
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 27 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Yury Norov Sept. 25, 2023, 2:05 a.m. UTC
Now that for_each_numa_hop_mask() is reverted, also revert reference to
it in the comment to cpumask_local_spread().

This partially reverts commit 2ac4980c57f5 ("lib/cpumask: update comment
for cpumask_local_spread()")

Signed-off-by: Yury Norov <yury.norov@gmail.com>
Signed-off-by: Yury Norov <ynorov@nvidia.com>
---
 lib/cpumask.c | 21 ---------------------
 1 file changed, 21 deletions(-)

Comments

Jacob Keller Sept. 25, 2023, 10:47 p.m. UTC | #1
On 9/24/2023 7:05 PM, Yury Norov wrote:
> Now that for_each_numa_hop_mask() is reverted, also revert reference to
> it in the comment to cpumask_local_spread().
> 
> This partially reverts commit 2ac4980c57f5 ("lib/cpumask: update comment
> for cpumask_local_spread()")
> 
> Signed-off-by: Yury Norov <yury.norov@gmail.com>
> Signed-off-by: Yury Norov <ynorov@nvidia.com>
> ---

Interesting to see both sign-offs here. Not sure what that implies here
since both represent you :)

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

>  lib/cpumask.c | 21 ---------------------
>  1 file changed, 21 deletions(-)
> 
> diff --git a/lib/cpumask.c b/lib/cpumask.c
> index a7fd02b5ae26..d341fb71a8a9 100644
> --- a/lib/cpumask.c
> +++ b/lib/cpumask.c
> @@ -117,27 +117,6 @@ void __init free_bootmem_cpumask_var(cpumask_var_t mask)
>   *
>   * Returns online CPU according to a numa aware policy; local cpus are returned
>   * first, followed by non-local ones, then it wraps around.
> - *
> - * For those who wants to enumerate all CPUs based on their NUMA distances,
> - * i.e. call this function in a loop, like:
> - *
> - * for (i = 0; i < num_online_cpus(); i++) {
> - *	cpu = cpumask_local_spread(i, node);
> - *	do_something(cpu);
> - * }
> - *
> - * 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;
> - *	}
> - *
> - * It's simpler and more verbose than above. Complexity of iterator-based
> - * enumeration is O(sched_domains_numa_levels * nr_cpu_ids), while
> - * cpumask_local_spread() when called for each cpu is
> - * O(sched_domains_numa_levels * nr_cpu_ids * log(nr_cpu_ids)).
>   */
>  unsigned int cpumask_local_spread(unsigned int i, int node)
>  {
Yury Norov Sept. 25, 2023, 10:53 p.m. UTC | #2
On Mon, Sep 25, 2023 at 3:48 PM Jacob Keller <jacob.e.keller@intel.com> wrote:
>
>
>
> On 9/24/2023 7:05 PM, Yury Norov wrote:
> > Now that for_each_numa_hop_mask() is reverted, also revert reference to
> > it in the comment to cpumask_local_spread().
> >
> > This partially reverts commit 2ac4980c57f5 ("lib/cpumask: update comment
> > for cpumask_local_spread()")
> >
> > Signed-off-by: Yury Norov <yury.norov@gmail.com>
> > Signed-off-by: Yury Norov <ynorov@nvidia.com>
> > ---
>
> Interesting to see both sign-offs here. Not sure what that implies here
> since both represent you :)
>
> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

Thanks for the review, Jacob. The 2nd sign-off is nothing interesting,
just bureaucracy.
diff mbox series

Patch

diff --git a/lib/cpumask.c b/lib/cpumask.c
index a7fd02b5ae26..d341fb71a8a9 100644
--- a/lib/cpumask.c
+++ b/lib/cpumask.c
@@ -117,27 +117,6 @@  void __init free_bootmem_cpumask_var(cpumask_var_t mask)
  *
  * Returns online CPU according to a numa aware policy; local cpus are returned
  * first, followed by non-local ones, then it wraps around.
- *
- * For those who wants to enumerate all CPUs based on their NUMA distances,
- * i.e. call this function in a loop, like:
- *
- * for (i = 0; i < num_online_cpus(); i++) {
- *	cpu = cpumask_local_spread(i, node);
- *	do_something(cpu);
- * }
- *
- * 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;
- *	}
- *
- * It's simpler and more verbose than above. Complexity of iterator-based
- * enumeration is O(sched_domains_numa_levels * nr_cpu_ids), while
- * cpumask_local_spread() when called for each cpu is
- * O(sched_domains_numa_levels * nr_cpu_ids * log(nr_cpu_ids)).
  */
 unsigned int cpumask_local_spread(unsigned int i, int node)
 {