linux-stable/tools/testing/memblock/tests
Karolina Drobnik 9d8f6abe98 memblock tests: Add memblock_alloc_try_nid tests for bottom up
Add checks for memblock_alloc_try_nid for bottom up allocation direction.
As the definition of this function is pretty close to the core
memblock_alloc_range_nid, the test cases implemented here cover most of
the code paths related to the memory allocations.

The tested scenarios are:
  - Region can be allocated within the requested range (both with aligned
    and misaligned boundaries)
  - Region can be allocated between two already existing entries
  - Not enough space between already reserved regions
  - Memory at the range boundaries is reserved but there is enough space
    to allocate a new region
  - The memory range is too narrow but memory can be allocated before
    the maximum address
  - Edge cases:
      + Minimum address is below memblock_start_of_DRAM()
      + Maximum address is above memblock_end_of_DRAM()

Add test case wrappers to test both directions in the same context.

Signed-off-by: Karolina Drobnik <karolinadrobnik@gmail.com>
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Link: https://lore.kernel.org/r/1c0ba11b8da5dc8f71ad45175c536fa4be720984.1646055639.git.karolinadrobnik@gmail.com
2022-03-09 15:55:35 +02:00
..
alloc_api.c memblock tests: Add memblock_alloc tests for bottom up 2022-03-09 15:54:02 +02:00
alloc_api.h memblock tests: Add memblock_alloc tests for top down 2022-03-09 15:53:18 +02:00
alloc_helpers_api.c memblock tests: Add memblock_alloc_from tests for bottom up 2022-03-09 15:54:03 +02:00
alloc_helpers_api.h memblock tests: Add memblock_alloc_from tests for top down 2022-03-09 15:54:03 +02:00
alloc_nid_api.c memblock tests: Add memblock_alloc_try_nid tests for bottom up 2022-03-09 15:55:35 +02:00
alloc_nid_api.h memblock tests: Add memblock_alloc_try_nid tests for top down 2022-03-09 15:54:04 +02:00
basic_api.c memblock tests: Add simulation of physical memory 2022-03-09 15:18:57 +02:00
basic_api.h memblock tests: Add simulation of physical memory 2022-03-09 15:18:57 +02:00
common.c memblock tests: Add simulation of physical memory 2022-03-09 15:18:57 +02:00
common.h memblock tests: Add simulation of physical memory 2022-03-09 15:18:57 +02:00