From: Yury Norov <yury.norov@gmail.com>
To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
linux-rdma@vger.kernel.org
Cc: Yury Norov <yury.norov@gmail.com>,
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>,
Jacob Keller <jacob.e.keller@intel.com>,
Yury Norov <ynorov@nvidia.com>
Subject: [PATCH 4/4] lib/cpumask: don't mention for_each_numa_hop_mask in cpumask_local_spread()"
Date: Sun, 24 Sep 2023 19:05:28 -0700 [thread overview]
Message-ID: <20230925020528.777578-5-yury.norov@gmail.com> (raw)
In-Reply-To: <20230925020528.777578-1-yury.norov@gmail.com>
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(-)
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)
{
--
2.39.2
next prev parent reply other threads:[~2023-09-25 2:05 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 ` Yury Norov [this message]
2023-09-25 22:47 ` [PATCH 4/4] lib/cpumask: don't mention for_each_numa_hop_mask in cpumask_local_spread()" Jacob Keller
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=20230925020528.777578-5-yury.norov@gmail.com \
--to=yury.norov@gmail.com \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=davem@davemloft.net \
--cc=dietmar.eggemann@arm.com \
--cc=edumazet@google.com \
--cc=jacob.e.keller@intel.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 \
/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;
as well as URLs for NNTP newsgroup(s).