lib/test_vmalloc.c: Fix compile error with CONFIG_TINY_RCU
Subsystems (3)
Uladzislau Rezki (Sony)
maintainerPATCH 1/1 lib/test_vmalloc.c: Fix compile error with CONFIG_TINY_RCU
When the kernel is built with CONFIG_TINY_RCU, compiling the test_vmalloc.c fails, due to conflicting definitions like "struct srcu_usage", etc. between "srcutiny.h" and "srcutree.h".
It happens because of direct including the "srcutree.h" bypassing the automatic selection mechanism. A correct approach is to include a generic <linux/srcu.h> which properly select SRCU implementation based on a kernel configuration.
Fix it by replacing the "srcutree.h" include with "srcu.h".
--- lib/test_vmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/test_vmalloc.c +1 -1
@@ -15,7 +15,7 @@#include <linux/delay.h> #include <linux/mm.h> #include <linux/rcupdate.h> -#include <linux/srcutree.h> +#include <linux/srcu.h> #include <linux/slab.h> #define __param (type, name, init, msg) \
Signature · 1 line
2.39.5
Andrew Morton
maintainerQuoted 9 lines · On Sun, 20 Apr 2025 16:20:29 +0200 "Uladzislau Rezki (Sony)"…
When the kernel is built with
CONFIG_TINY_RCU, compiling thetest_vmalloc.cfails, due to conflicting definitions like "structsrcu_usage", etc. between "srcutiny.h" and "srcutree.h".It happens because of direct including the "
srcutree.h" bypassing the automatic selection mechanism. A correct approach is to include a generic <linux/srcu.h> which properly select SRCU implementation based on a kernel configuration.
Quoted 5 lines
Fix it by replacing the "
srcutree.h" include with "srcu.h".
Thanks.
This is a fix against the mm-unstable patch "lib/test_vmalloc.c:
replace RWSEM to SRCU for setup".