* [PATCH] mm: remove the exporting of totalram_pages
@ 2019-07-10 14:10 Denis Efremov
2019-07-10 14:24 ` Michal Hocko
0 siblings, 1 reply; 2+ messages in thread
From: Denis Efremov @ 2019-07-10 14:10 UTC (permalink / raw)
To: Arun KS
Cc: Denis Efremov, Andrew Morton, Michal Hocko, Vlastimil Babka,
Oscar Salvador, Pavel Tatashin, Mel Gorman, Mike Rapoport,
Alexander Duyck, linux-mm, linux-kernel
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")
Signed-off-by: Denis Efremov <efremov@linux.com>
---
mm/page_alloc.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 8e3bc949ebcc..060303496094 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -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",
--
2.21.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mm: remove the exporting of totalram_pages
2019-07-10 14:10 [PATCH] mm: remove the exporting of totalram_pages Denis Efremov
@ 2019-07-10 14:24 ` Michal Hocko
0 siblings, 0 replies; 2+ messages in thread
From: Michal Hocko @ 2019-07-10 14:24 UTC (permalink / raw)
To: Denis Efremov
Cc: Arun KS, Andrew Morton, Vlastimil Babka, Oscar Salvador,
Pavel Tatashin, Mel Gorman, Mike Rapoport, Alexander Duyck,
linux-mm, linux-kernel
On Wed 10-07-19 17:10:31, Denis Efremov wrote:
> 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")
> Signed-off-by: Denis Efremov <efremov@linux.com>
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.
Acked-by: Michal Hocko <mhocko@suse.com>
> ---
> mm/page_alloc.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 8e3bc949ebcc..060303496094 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -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",
> --
> 2.21.0
--
Michal Hocko
SUSE Labs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-10 14:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-10 14:10 [PATCH] mm: remove the exporting of totalram_pages Denis Efremov
2019-07-10 14:24 ` Michal Hocko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).