[PATCH 0/4] memblock tests: add NUMA tests for memblock_alloc_try_nid*

From: Rebecca Mckeever
Date: Sun Aug 14 2022 - 02:07:26 EST


These patches add additional tests for memblock_alloc_try_nid() and
memblock_alloc_try_nid_raw() that use a simulated physical
memory that is set up with multiple NUMA nodes. Additionally, most of
these tests set nid != NUMA_NO_NODE.

To set up a simulated physical memory with multiple NUMA nodes, patch 1
introduces setup_numa_memblock_generic() and setup_numa_memblock().
These functions use a previously allocated dummy physical memory. They
can be used in place of setup_memblock() in tests that need to simulate
a NUMA system.

These tests are run twice, once for memblock_alloc_try_nid() and once
for memblock_alloc_try_nid_raw(), so that both functions are tested with
the same set of tests. When the tests run memblock_alloc_try_nid(), they
test that the entire memory region is zero. When the tests run
memblock_alloc_try_nid_raw(), they test that the entire memory region is
nonzero.

Note:
This patchset depends on the following patch set:
https://lore.kernel.org/linux-mm/cover.1660454730.git.remckee0@xxxxxxxxx/T/#m3a63677ae915fb47aea3f82780b72b54c08f246d

Rebecca Mckeever (4):
memblock tests: add simulation of physical memory with multiple NUMA
nodes
memblock tests: add top-down NUMA tests for memblock_alloc_try_nid*
memblock tests: add bottom-up NUMA tests for memblock_alloc_try_nid*
memblock tests: add generic NUMA tests for memblock_alloc_try_nid*

.../testing/memblock/scripts/Makefile.include | 2 +-
tools/testing/memblock/tests/alloc_nid_api.c | 1489 ++++++++++++++++-
tools/testing/memblock/tests/alloc_nid_api.h | 16 +
tools/testing/memblock/tests/common.c | 38 +
tools/testing/memblock/tests/common.h | 27 +-
5 files changed, 1559 insertions(+), 13 deletions(-)

--
2.25.1