[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <xhsmh8rehkxzz.mognet@vschneid.remote.csb>
Date: Mon, 24 Apr 2023 18:09:52 +0100
From: Valentin Schneider <vschneid@...hat.com>
To: Yury Norov <yury.norov@...il.com>,
Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Yury Norov <yury.norov@...il.com>,
Saeed Mahameed <saeedm@...dia.com>,
Pawel Chmielewski <pawel.chmielewski@...el.com>,
Leon Romanovsky <leon@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Tariq Toukan <tariqt@...dia.com>,
Gal Pressman <gal@...dia.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Heiko Carstens <hca@...ux.ibm.com>,
Barry Song <baohua@...nel.org>
Subject: Re: [PATCH v2 7/8] lib: add test for for_each_numa_{cpu,hop_mask}()
On 19/04/23 22:19, Yury Norov wrote:
> + for (node = 0; node < sched_domains_numa_levels; node++) {
> + unsigned int hop, c = 0;
> +
> + rcu_read_lock();
> + for_each_numa_cpu(cpu, hop, node, cpu_online_mask)
> + expect_eq_uint(cpumask_local_spread(c++, node), cpu);
> + rcu_read_unlock();
> + }
I'm not fond of the export of sched_domains_numa_levels, especially
considering it's just there for tests.
Furthermore, is there any value is testing parity with
cpumask_local_spread()? Rather, shouldn't we check that using this API does
yield CPUs of increasing NUMA distance?
Something like
for_each_node(node) {
unsigned int prev_cpu, hop = 0;
cpu = cpumask_first(cpumask_of_node(node));
prev_cpu = cpu;
rcu_read_lock();
/* Assert distance is monotonically increasing */
for_each_numa_cpu(cpu, hop, node, cpu_online_mask) {
expect_ge_uint(cpu_to_node(cpu), cpu_to_node(prev_cpu));
prev_cpu = cpu;
}
rcu_read_unlock();
}
Powered by blists - more mailing lists