e15e06a839
This is a test suite that uses the radix test infrastructure. It has been split into its own commit to allow for easier review of the maple tree code. The testing includes: - Allocation of nodes - gfp flag allocation checks - Expansion & contraction of tree - preallocation checks - tree navigation by next/prev - tree navigation by iterators (mas_for_each, etc) - Number of nodes for a given number of entries - Generic tree construction tests - Addition and removal of entries in forward and reverse numerical indexes - gap searching both forward and reverse - Combining gaps by overwriting entries in different ways - splitting right-most node - splitting left-most node - overwriting multiple slots - overwriting across different levels of the tree - overwriting the middle of a tree - causing a 3-way split up to the root by overwriting the last slot and first slot of different nodes and spanning different levels - RCU stress testing of the tree with threads - Duplication of the tree by entry count - Tests which were generated by fuzzers have been added. - A large number of tests which come from recording crashing in a VM and reconstructing the tree (see check_erase2_set()) Link: https://lkml.kernel.org/r/20220906194824.2110408-8-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com> Tested-by: Yu Zhao <yuzhao@google.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: David Hildenbrand <david@redhat.com> Cc: David Howells <dhowells@redhat.com> Cc: Davidlohr Bueso <dave@stgolabs.net> Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org> Cc: SeongJae Park <sj@kernel.org> Cc: Sven Schnelle <svens@linux.ibm.com> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Will Deacon <will@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
64 lines
1.7 KiB
Makefile
64 lines
1.7 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
CFLAGS += -I. -I../../include -g -Og -Wall -D_LGPL_SOURCE -fsanitize=address \
|
|
-fsanitize=undefined
|
|
LDFLAGS += -fsanitize=address -fsanitize=undefined
|
|
LDLIBS+= -lpthread -lurcu
|
|
TARGETS = main idr-test multiorder xarray maple
|
|
CORE_OFILES := xarray.o radix-tree.o idr.o linux.o test.o find_bit.o bitmap.o \
|
|
slab.o maple.o
|
|
OFILES = main.o $(CORE_OFILES) regression1.o regression2.o regression3.o \
|
|
regression4.o tag_check.o multiorder.o idr-test.o iteration_check.o \
|
|
iteration_check_2.o benchmark.o
|
|
|
|
ifndef SHIFT
|
|
SHIFT=3
|
|
endif
|
|
|
|
ifeq ($(BUILD), 32)
|
|
CFLAGS += -m32
|
|
LDFLAGS += -m32
|
|
endif
|
|
|
|
targets: generated/map-shift.h $(TARGETS)
|
|
|
|
main: $(OFILES)
|
|
|
|
idr-test.o: ../../../lib/test_ida.c
|
|
idr-test: idr-test.o $(CORE_OFILES)
|
|
|
|
xarray: $(CORE_OFILES)
|
|
|
|
maple: $(CORE_OFILES)
|
|
|
|
multiorder: multiorder.o $(CORE_OFILES)
|
|
|
|
clean:
|
|
$(RM) $(TARGETS) *.o radix-tree.c idr.c generated/map-shift.h
|
|
|
|
vpath %.c ../../lib
|
|
|
|
$(OFILES): Makefile *.h */*.h generated/map-shift.h \
|
|
../../include/linux/*.h \
|
|
../../include/asm/*.h \
|
|
../../../include/linux/xarray.h \
|
|
../../../include/linux/maple_tree.h \
|
|
../../../include/linux/radix-tree.h \
|
|
../../../include/linux/idr.h
|
|
|
|
radix-tree.c: ../../../lib/radix-tree.c
|
|
sed -e 's/^static //' -e 's/__always_inline //' -e 's/inline //' < $< > $@
|
|
|
|
idr.c: ../../../lib/idr.c
|
|
sed -e 's/^static //' -e 's/__always_inline //' -e 's/inline //' < $< > $@
|
|
|
|
xarray.o: ../../../lib/xarray.c ../../../lib/test_xarray.c
|
|
|
|
maple.o: ../../../lib/maple_tree.c ../../../lib/test_maple_tree.c
|
|
|
|
generated/map-shift.h:
|
|
@if ! grep -qws $(SHIFT) generated/map-shift.h; then \
|
|
echo "#define XA_CHUNK_SHIFT $(SHIFT)" > \
|
|
generated/map-shift.h; \
|
|
fi
|