Skip to contentSkip to conversation

mm: vmalloc: Mark vmap_init_free_space() with __init tag

PATCH In review Uladzislau Rezki (Sony) 4 participants 4 messages Jan 11, 2024 – Jan 17, 2024

Subsystems (2)
lore
Share & tools
lore

Uladzislau Rezki (Sony)

author maintainer
#0 lore raw

PATCH 1/1 mm: vmalloc: Mark vmap_init_free_space() with __init tag

The vmap_init_free_space() function is called only once therefore tag it with __init. Apart of that it access the "vmlist" variable that is located in ".init.data" section.

Fixes 86817057732 ("mm: vmalloc: remove global vmap_area_root rb-tree")
---
 mm/vmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/vmalloc.c +1 -1
index 43a6608e1397..257981e37936 100644
@@ -4834,7 +4834,7 @@ module_init(proc_vmalloc_init);
 
 #endif
 
-static void vmap_init_free_space(void)
+static void __init vmap_init_free_space(void)
 {
 	unsigned long vmap_start = 1;
 	const unsigned long vmap_end = ULONG_MAX;
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#2 lore raw
In reply to Uladzislau Rezki (Sony)
Quoted 26 lines · Uladzislau Rezki (Sony)

The vmap_init_free_space() function is called only once therefore tag it with __init. Apart of that it access the "vmlist" variable that is located in ".init.data" section.

Fixes 86817057732 ("mm: vmalloc: remove global vmap_area_root rb-tree")
---
 mm/vmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/vmalloc.c +1 -2
index 43a6608e1397..257981e37936 100644
@@ -4834,7 +4834,7 @@ module_init(proc_vmalloc_init);
 
 #endif
 
-static void vmap_init_free_space(void)
+static void __init vmap_init_free_space(void)
 {
 	unsigned long vmap_start = 1;
 	const unsigned long vmap_end = ULONG_MAX;
--
Quoted 2 lines

2.39.2

Looks good to me too. Feel free to add:

Reviewed-by on v1 1/1
#3 lore raw
In reply to Uladzislau Rezki (Sony)
Quoted 17 lines · Uladzislau Rezki (Sony)

The vmap_init_free_space() function is called only once therefore tag it with __init. Apart of that it access the "vmlist" variable that is located in ".init.data" section.

Fixes 86817057732 ("mm: vmalloc: remove global vmap_area_root rb-tree")
---
 mm/vmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/vmalloc.c +0 -0
index 43a6608e1397..257981e37936 100644

mm/vmalloc.c module_init(proc_vmalloc_init); · line 4840

Quoted 8 lines
mm/vmalloc.c +1 -1
@@ -4834,7 +4834,7 @@ module_init(proc_vmalloc_init);
 
 #endif
 
-static void vmap_init_free_space(void)
+static void __init vmap_init_free_space(void)
 {
 	unsigned long vmap_start = 1;
 	const unsigned long vmap_end = ULONG_MAX;

LGTM