2022-04-14 09:29:10

by Bruno Goncalves

[permalink] [raw]
Subject: testing/radix-tree: undefined reference to `kmem_cache_alloc_lru'

Hello,

Trying to build testing/radix-tree on mainline kernel fails with:

make -C tools/testing/radix-tree/
<snip>
cc -fsanitize=address -fsanitize=undefined main.o xarray.o
radix-tree.o idr.o linux.o test.o find_bit.o bitmap.o slab.o
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 -lpthread -lurcu -o main
/usr/bin/ld: xarray.o: in function `xas_split_alloc':
/root/linux/tools/testing/radix-tree/../../../lib/xarray.c:1019:
undefined reference to `kmem_cache_alloc_lru'
/usr/bin/ld: xarray.o: in function `xas_nomem':
/root/linux/tools/testing/radix-tree/../../../lib/xarray.c:305:
undefined reference to `kmem_cache_alloc_lru'
/usr/bin/ld: xarray.o: in function `xas_alloc':
/root/linux/tools/testing/radix-tree/../../../lib/xarray.c:374:
undefined reference to `kmem_cache_alloc_lru'
/usr/bin/ld: xarray.o: in function `__xas_nomem':
/root/linux/tools/testing/radix-tree/../../../lib/xarray.c:337:
undefined reference to `kmem_cache_alloc_lru'
/usr/bin/ld: /root/linux/tools/testing/radix-tree/../../../lib/xarray.c:340:
undefined reference to `kmem_cache_alloc_lru'
collect2: error: ld returned 1 exit status
make: *** [<builtin>: main] Error 1

Thanks,
Bruno Goncalves


2022-04-16 02:23:03

by Matthew Wilcox

[permalink] [raw]
Subject: Re: testing/radix-tree: undefined reference to `kmem_cache_alloc_lru'

On Fri, Apr 15, 2022 at 12:19:29PM +0800, Li Wang wrote:
> Cc'ing Matthew and Muchun for being aware of this.
>
> Seems we have to port the new kmem_cache_alloc_lru() function into
> tools/testing/radix-tree/linux.c as well.

I have that fix, just haven't sent it to Linus yet.