diff options
| author | Rebecca Mckeever <remckee0@gmail.com> | 2022-11-07 00:28:06 -0600 |
|---|---|---|
| committer | Mike Rapoport <rppt@linux.ibm.com> | 2022-11-08 09:50:24 +0200 |
| commit | bfc05a4ce3650a1e5a47ccdaf8c87f814829b4a7 (patch) | |
| tree | f7ccab4a7a1f93965f0d857b4b110e6bc5e67be7 /tools/testing/memblock/tests/alloc_exact_nid_api.h | |
| parent | 61da03328a603d2d4a5b2e80cbe29bbf0122e6f8 (diff) | |
| download | linux-bfc05a4ce3650a1e5a47ccdaf8c87f814829b4a7.tar.gz | |
memblock tests: add top-down NUMA tests for memblock_alloc_exact_nid_raw
Add tests for memblock_alloc_exact_nid_raw() where the simulated physical
memory is set up with multiple NUMA nodes. Additionally, all of these
tests set nid != NUMA_NO_NODE. These tests are run with a top-down
allocation direction.
The tested scenarios are:
Range unrestricted:
- region can be allocated in the specific node requested:
+ there are no previously reserved regions
+ the requested node is partially reserved but has enough space
Range restricted:
- region can be allocated in the specific node requested after dropping
min_addr:
+ range partially overlaps with two different nodes, where the
first node is the requested node
+ range partially overlaps with two different nodes, where the
requested node ends before min_addr
+ range overlaps with multiple nodes along node boundaries, and
the requested node ends before min_addr
Acked-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Link: https://lore.kernel.org/r/2cc0883243d68ddc3faf833d2d9e86f48534c1d7.1667802195.git.remckee0@gmail.com
Diffstat (limited to 'tools/testing/memblock/tests/alloc_exact_nid_api.h')
| -rw-r--r-- | tools/testing/memblock/tests/alloc_exact_nid_api.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/testing/memblock/tests/alloc_exact_nid_api.h b/tools/testing/memblock/tests/alloc_exact_nid_api.h index 4408719de3b9..cef419d55d2a 100644 --- a/tools/testing/memblock/tests/alloc_exact_nid_api.h +++ b/tools/testing/memblock/tests/alloc_exact_nid_api.h @@ -5,5 +5,21 @@ #include "common.h" int memblock_alloc_exact_nid_checks(void); +int __memblock_alloc_exact_nid_numa_checks(void); + +#ifdef CONFIG_NUMA +static inline int memblock_alloc_exact_nid_numa_checks(void) +{ + __memblock_alloc_exact_nid_numa_checks(); + return 0; +} + +#else +static inline int memblock_alloc_exact_nid_numa_checks(void) +{ + return 0; +} + +#endif /* CONFIG_NUMA */ #endif |
