]> www.infradead.org Git - users/willy/pagecache.git/commit
lib: test for_each_numa_cpus()
authorYury Norov <yury.norov@gmail.com>
Sun, 30 Apr 2023 17:18:09 +0000 (10:18 -0700)
committerYury Norov <yury.norov@gmail.com>
Tue, 18 Jul 2023 20:27:35 +0000 (13:27 -0700)
commit94b1547668965e1fde8bde3638845ab582b40034
tree46d41025337046e6268f5f654a88fd4390e41a34
parentb9833b80d87030b0def7aeda88471ac7f6acd3cb
lib: test for_each_numa_cpus()

Test for_each_numa_cpus() output to ensure that:
 - all CPUs are picked from NUMA nodes with non-decreasing distances to the
   original node;
 - only online CPUs are enumerated;
 - the macro enumerates each online CPUs only once;
 - enumeration order is consistent with cpumask_local_spread().

The latter is an implementation-defined behavior. If cpumask_local_spread()
or for_each_numa_cpu() will get changed in future, the subtest may need
to be adjusted or even removed, as appropriate.

It's useful now because some architectures don't implement numa_distance(),
and generic implementation only distinguishes local and remote nodes, which
doesn't allow to test the for_each_numa_cpu() properly.

Suggested-by: Valentin Schneider <vschneid@redhat.com> (for node_distance() test)
Signed-off-by: Yury Norov <yury.norov@gmail.com>
lib/test_bitmap.c