Skip to contentSkip to conversation

mm: remove the exporting of totalram_pages

PATCH In review Denis Efremov 2 participants 2 messages Jul 10, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: remove the exporting of totalram_pages

Previously totalram_pages was the global variable. Currently, totalram_pages is the static inline function from the include/linux/mm.h However, the function is also marked as EXPORT_SYMBOL, which is at best an odd combination. Because there is no point for the static inline function from a public header to be exported, this commit removes the EXPORT_SYMBOL() marking. It will be still possible to use the function in modules because all the symbols it depends on are exported.

Fixes ca79b0c211af6 ("mm: convert totalram_pages and totalhigh_pages variables to atomic")
---
 mm/page_alloc.c | 2 --
 1 file changed, 2 deletions(-)
mm/page_alloc.c +0 -2
index 8e3bc949ebcc..060303496094 100644
@@ -224,8 +224,6 @@ int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES] = {
 	[ZONE_MOVABLE] = 0,
 };
 
-EXPORT_SYMBOL(totalram_pages);
-
 static char * const zone_names[MAX_NR_ZONES] = {
 #ifdef CONFIG_ZONE_DMA
 	 "DMA",
Signature · 1 line
2.21.0
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Denis Efremov

Previously totalram_pages was the global variable. Currently, totalram_pages is the static inline function from the include/linux/mm.h However, the function is also marked as EXPORT_SYMBOL, which is at best an odd combination. Because there is no point for the static inline function from a public header to be exported, this commit removes the EXPORT_SYMBOL() marking. It will be still possible to use the function in modules because all the symbols it depends on are exported.

Fixes ca79b0c211af6 ("mm: convert totalram_pages and totalhigh_pages variables to atomic")

I have to confess I am not entirely sure what the export actually does in this case. I _think_ it will simply create a symbol and the code will be same as the static inline. But it certainly is not what we want/need.

Quoted 19 lines
---
 mm/page_alloc.c | 2 --
 1 file changed, 2 deletions(-)
mm/page_alloc.c +0 -2
index 8e3bc949ebcc..060303496094 100644
@@ -224,8 +224,6 @@ int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES] = {
 	[ZONE_MOVABLE] = 0,
 };
 
-EXPORT_SYMBOL(totalram_pages);
-
 static char * const zone_names[MAX_NR_ZONES] = {
 #ifdef CONFIG_ZONE_DMA
 	 "DMA",
Signature · 1 line
2.21.0
Signature · 2 lines
Michal Hocko
SUSE Labs