The IDR is very similar to the radix tree. It has some functionality that the radix tree did not have (alloc next free, cyclic allocation, a callback-based for_each, destroy tree), which is readily implementable on top of the radix tree. A few small changes were needed in order to use a tag to represent nodes with free space below them. More extensive changes were needed to support storing NULL as a valid entry in an IDR. Plain radix trees still interpret NULL as a not-present entry. The IDA is reimplemented as a client of the newly enhanced radix tree. As in the current implementation, it uses a bitmap at the last level of the tree. Signed-off-by: Matthew Wilcox <willy@infradead.org> Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com> Tested-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Konstantin Khlebnikov <koct9i@gmail.com> Cc: Ross Zwisler <ross.zwisler@linux.intel.com> Cc: Tejun Heo <tj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
34 lines
843 B
Makefile
34 lines
843 B
Makefile
|
|
CFLAGS += -I. -I../../include -g -O2 -Wall -D_LGPL_SOURCE
|
|
LDFLAGS += -lpthread -lurcu
|
|
TARGETS = main
|
|
OFILES = main.o radix-tree.o idr.o linux.o test.o tag_check.o find_bit.o \
|
|
regression1.o regression2.o regression3.o multiorder.o idr-test.o \
|
|
iteration_check.o benchmark.o
|
|
|
|
ifdef BENCHMARK
|
|
CFLAGS += -DBENCHMARK=1
|
|
endif
|
|
|
|
targets: $(TARGETS)
|
|
|
|
main: $(OFILES)
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $(OFILES) -o main
|
|
|
|
clean:
|
|
$(RM) -f $(TARGETS) *.o radix-tree.c
|
|
|
|
vpath %.c ../../lib
|
|
|
|
$(OFILES): *.h */*.h \
|
|
../../include/linux/*.h \
|
|
../../include/asm/*.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 //' < $< > $@
|