Skip to contentSkip to conversation

lib/test_vmalloc.c: Fix compile error with CONFIG_TINY_RCU

PATCH In review Uladzislau Rezki (Sony) 2 participants 2 messages Apr 20, 2025

Subsystems (3)
lore
Share & tools
lore

Uladzislau Rezki (Sony)

author maintainer
#0 lore raw

PATCH 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
index 6d65ef725d42c..1b0b59549aaf1 100644
@@ -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
maintainer
#1 lore raw
Quoted 9 lines · On Sun, 20 Apr 2025 16:20:29 +0200 "Uladzislau Rezki (Sony)"…

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.

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".