mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: Yury Norov <yury.norov@gmail.com>, <linux-kernel@vger.kernel.org>,
	<netdev@vger.kernel.org>, <linux-rdma@vger.kernel.org>
Cc: Tariq Toukan <ttoukan.linux@gmail.com>,
	Valentin Schneider <vschneid@redhat.com>,
	Maher Sanalla <msanalla@nvidia.com>,
	Ingo Molnar <mingo@kernel.org>, Mel Gorman <mgorman@suse.de>,
	Saeed Mahameed <saeedm@nvidia.com>,
	Leon Romanovsky <leon@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	Pawel Chmielewski <pawel.chmielewski@intel.com>,
	Yury Norov <ynorov@nvidia.com>
Subject: Re: [PATCH 4/4] lib/cpumask: don't mention for_each_numa_hop_mask in cpumask_local_spread()"
Date: Mon, 25 Sep 2023 15:47:57 -0700	[thread overview]
Message-ID: <dbfd06ab-26f3-7b32-6025-2c55e223c576@intel.com> (raw)
In-Reply-To: <20230925020528.777578-5-yury.norov@gmail.com>



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)
>  {

  reply	other threads:[~2023-09-25 22:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-25  2:05 [PATCH 0/4] sched: drop for_each_numa_hop_mask() Yury Norov
2023-09-25  2:05 ` [PATCH 1/4] net: mellanox: drop mlx5_cpumask_default_spread() Yury Norov
2023-09-25 22:45   ` Jacob Keller
2023-10-03 10:04   ` Paolo Abeni
2023-10-03 13:46     ` Yury Norov
2023-10-03 22:20       ` Jakub Kicinski
2023-10-04  1:31         ` Yury Norov
2023-10-04 17:19           ` Jakub Kicinski
2023-09-25  2:05 ` [PATCH 2/4] Revert "sched/topology: Introduce for_each_numa_hop_mask()" Yury Norov
2023-09-25 22:46   ` Jacob Keller
2023-09-25 22:55     ` Yury Norov
2023-09-25 23:01       ` Jacob Keller
2023-09-25  2:05 ` [PATCH 3/4] Revert "sched/topology: Introduce sched_numa_hop_mask()" Yury Norov
2023-09-25 22:46   ` Jacob Keller
2023-09-25  2:05 ` [PATCH 4/4] lib/cpumask: don't mention for_each_numa_hop_mask in cpumask_local_spread()" Yury Norov
2023-09-25 22:47   ` Jacob Keller [this message]
2023-09-25 22:53     ` Yury Norov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dbfd06ab-26f3-7b32-6025-2c55e223c576@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=davem@davemloft.net \
    --cc=dietmar.eggemann@arm.com \
    --cc=edumazet@google.com \
    --cc=juri.lelli@redhat.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@kernel.org \
    --cc=msanalla@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pawel.chmielewski@intel.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=saeedm@nvidia.com \
    --cc=ttoukan.linux@gmail.com \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=ynorov@nvidia.com \
    --cc=yury.norov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®