linux/tools/testing/memblock
Karolina Drobnik 8f98435d67 memblock tests: Add memblock_alloc_try_nid tests for top down
Add tests for memblock_alloc_try_nid for top down 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 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 checks for both allocation directions:
  - Region starts at the min_addr and ends at max_addr
  - Maximum address is too close to the beginning of the available
    memory
  - Memory at the range boundaries is reserved but there is enough space
    to allocate a new region

Signed-off-by: Karolina Drobnik <karolinadrobnik@gmail.com>
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Link: https://lore.kernel.org/r/d6c282e0f9f62c15bf74c216214604764232d637.1646055639.git.karolinadrobnik@gmail.com
2022-03-09 15:54:04 +02:00
..
asm
lib
linux
scripts memblock tests: Fix testing with 32-bit physical addresses 2022-03-05 19:46:46 +02:00
tests memblock tests: Add memblock_alloc_try_nid tests for top down 2022-03-09 15:54:04 +02:00
.gitignore
internal.h
main.c memblock tests: Add memblock_alloc_try_nid tests for top down 2022-03-09 15:54:04 +02:00
Makefile memblock tests: Add memblock_alloc_try_nid tests for top down 2022-03-09 15:54:04 +02:00
mmzone.c