summaryrefslogtreecommitdiff
path: root/tools/testing/memblock/Makefile
diff options
context:
space:
mode:
authorKarolina Drobnik <karolinadrobnik@gmail.com>2022-02-28 17:46:49 +0300
committerMike Rapoport <rppt@linux.ibm.com>2022-03-09 16:54:04 +0300
commit8f98435d674e5b7ec382914d2755849f5a95754b (patch)
tree9c41fbcd478a4860530f88bf9bd82a55bb5f3177 /tools/testing/memblock/Makefile
parent0ac06631a3bcdaed497f7b8abccf405f9eb8e0bd (diff)
downloadlinux-8f98435d674e5b7ec382914d2755849f5a95754b.tar.xz
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
Diffstat (limited to 'tools/testing/memblock/Makefile')
-rw-r--r--tools/testing/memblock/Makefile4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/memblock/Makefile b/tools/testing/memblock/Makefile
index 89e374470009..a698e24b35e7 100644
--- a/tools/testing/memblock/Makefile
+++ b/tools/testing/memblock/Makefile
@@ -6,8 +6,8 @@ CFLAGS += -I. -I../../include -Wall -O2 -fsanitize=address \
-fsanitize=undefined -D CONFIG_PHYS_ADDR_T_64BIT
LDFLAGS += -fsanitize=address -fsanitize=undefined
TARGETS = main
-TEST_OFILES = tests/alloc_helpers_api.o tests/alloc_api.o tests/basic_api.o \
- tests/common.o
+TEST_OFILES = tests/alloc_nid_api.o tests/alloc_helpers_api.o tests/alloc_api.o \
+ tests/basic_api.o tests/common.o
DEP_OFILES = memblock.o lib/slab.o mmzone.o slab.o
OFILES = main.o $(DEP_OFILES) $(TEST_OFILES)
EXTR_SRC = ../../../mm/memblock.c