diff options
author | Oscar Salvador <osalvador@suse.de> | 2018-12-28 03:37:24 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-12-28 15:11:49 -0500 |
commit | bbe5d9939e81277bfbfb8fdba68374024b16d5fa (patch) | |
tree | bc48bc97175fab2dd6c446bc7835d05b5595e1aa /mm/page_alloc.c | |
parent | 3fa750dcf29e8606e3969d13d8e188cc1c0f511d (diff) |
mm/page_alloc.c: drop uneeded __meminit and __meminitdata
Since commit 03e85f9d5f1 ("mm/page_alloc: Introduce
free_area_init_core_hotplug"), some functions changed to only be called
during system initialization. Concretly, free_area_init_node() and the
functions that hang from it.
Also, some variables are no longer used after the system has gone
through initialization. So this could be considered as a late clean-up
for that patch.
This patch changes the functions from __meminit to __init, and the
variables from __meminitdata to __initdata.
In return, we get some KBs back:
Before:
Freeing unused kernel image memory: 2472K
After:
Freeing unused kernel image memory: 2480K
Link: http://lkml.kernel.org/r/20181204111507.4808-1-osalvador@suse.de
Signed-off-by: Oscar Salvador <osalvador@suse.de>
Reviewed-by: Wei Yang <richard.weiyang@gmail.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Pavel Tatashin <pavel.tatashin@microsoft.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Cc: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index a1e5f0de76bd..b4fcf211ca69 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -265,18 +265,18 @@ int user_min_free_kbytes = -1; | |||
265 | int watermark_boost_factor __read_mostly = 15000; | 265 | int watermark_boost_factor __read_mostly = 15000; |
266 | int watermark_scale_factor = 10; | 266 | int watermark_scale_factor = 10; |
267 | 267 | ||
268 | static unsigned long nr_kernel_pages __meminitdata; | 268 | static unsigned long nr_kernel_pages __initdata; |
269 | static unsigned long nr_all_pages __meminitdata; | 269 | static unsigned long nr_all_pages __initdata; |
270 | static unsigned long dma_reserve __meminitdata; | 270 | static unsigned long dma_reserve __initdata; |
271 | 271 | ||
272 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP | 272 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP |
273 | static unsigned long arch_zone_lowest_possible_pfn[MAX_NR_ZONES] __meminitdata; | 273 | static unsigned long arch_zone_lowest_possible_pfn[MAX_NR_ZONES] __initdata; |
274 | static unsigned long arch_zone_highest_possible_pfn[MAX_NR_ZONES] __meminitdata; | 274 | static unsigned long arch_zone_highest_possible_pfn[MAX_NR_ZONES] __initdata; |
275 | static unsigned long required_kernelcore __initdata; | 275 | static unsigned long required_kernelcore __initdata; |
276 | static unsigned long required_kernelcore_percent __initdata; | 276 | static unsigned long required_kernelcore_percent __initdata; |
277 | static unsigned long required_movablecore __initdata; | 277 | static unsigned long required_movablecore __initdata; |
278 | static unsigned long required_movablecore_percent __initdata; | 278 | static unsigned long required_movablecore_percent __initdata; |
279 | static unsigned long zone_movable_pfn[MAX_NUMNODES] __meminitdata; | 279 | static unsigned long zone_movable_pfn[MAX_NUMNODES] __initdata; |
280 | static bool mirrored_kernelcore __meminitdata; | 280 | static bool mirrored_kernelcore __meminitdata; |
281 | 281 | ||
282 | /* movable_zone is the "real" zone pages in ZONE_MOVABLE are taken from */ | 282 | /* movable_zone is the "real" zone pages in ZONE_MOVABLE are taken from */ |
@@ -6034,7 +6034,7 @@ void __init sparse_memory_present_with_active_regions(int nid) | |||
6034 | * with no available memory, a warning is printed and the start and end | 6034 | * with no available memory, a warning is printed and the start and end |
6035 | * PFNs will be 0. | 6035 | * PFNs will be 0. |
6036 | */ | 6036 | */ |
6037 | void __meminit get_pfn_range_for_nid(unsigned int nid, | 6037 | void __init get_pfn_range_for_nid(unsigned int nid, |
6038 | unsigned long *start_pfn, unsigned long *end_pfn) | 6038 | unsigned long *start_pfn, unsigned long *end_pfn) |
6039 | { | 6039 | { |
6040 | unsigned long this_start_pfn, this_end_pfn; | 6040 | unsigned long this_start_pfn, this_end_pfn; |
@@ -6083,7 +6083,7 @@ static void __init find_usable_zone_for_movable(void) | |||
6083 | * highest usable zone for ZONE_MOVABLE. This preserves the assumption that | 6083 | * highest usable zone for ZONE_MOVABLE. This preserves the assumption that |
6084 | * zones within a node are in order of monotonic increases memory addresses | 6084 | * zones within a node are in order of monotonic increases memory addresses |
6085 | */ | 6085 | */ |
6086 | static void __meminit adjust_zone_range_for_zone_movable(int nid, | 6086 | static void __init adjust_zone_range_for_zone_movable(int nid, |
6087 | unsigned long zone_type, | 6087 | unsigned long zone_type, |
6088 | unsigned long node_start_pfn, | 6088 | unsigned long node_start_pfn, |
6089 | unsigned long node_end_pfn, | 6089 | unsigned long node_end_pfn, |
@@ -6114,7 +6114,7 @@ static void __meminit adjust_zone_range_for_zone_movable(int nid, | |||
6114 | * Return the number of pages a zone spans in a node, including holes | 6114 | * Return the number of pages a zone spans in a node, including holes |
6115 | * present_pages = zone_spanned_pages_in_node() - zone_absent_pages_in_node() | 6115 | * present_pages = zone_spanned_pages_in_node() - zone_absent_pages_in_node() |
6116 | */ | 6116 | */ |
6117 | static unsigned long __meminit zone_spanned_pages_in_node(int nid, | 6117 | static unsigned long __init zone_spanned_pages_in_node(int nid, |
6118 | unsigned long zone_type, | 6118 | unsigned long zone_type, |
6119 | unsigned long node_start_pfn, | 6119 | unsigned long node_start_pfn, |
6120 | unsigned long node_end_pfn, | 6120 | unsigned long node_end_pfn, |
@@ -6149,7 +6149,7 @@ static unsigned long __meminit zone_spanned_pages_in_node(int nid, | |||
6149 | * Return the number of holes in a range on a node. If nid is MAX_NUMNODES, | 6149 | * Return the number of holes in a range on a node. If nid is MAX_NUMNODES, |
6150 | * then all holes in the requested range will be accounted for. | 6150 | * then all holes in the requested range will be accounted for. |
6151 | */ | 6151 | */ |
6152 | unsigned long __meminit __absent_pages_in_range(int nid, | 6152 | unsigned long __init __absent_pages_in_range(int nid, |
6153 | unsigned long range_start_pfn, | 6153 | unsigned long range_start_pfn, |
6154 | unsigned long range_end_pfn) | 6154 | unsigned long range_end_pfn) |
6155 | { | 6155 | { |
@@ -6179,7 +6179,7 @@ unsigned long __init absent_pages_in_range(unsigned long start_pfn, | |||
6179 | } | 6179 | } |
6180 | 6180 | ||
6181 | /* Return the number of page frames in holes in a zone on a node */ | 6181 | /* Return the number of page frames in holes in a zone on a node */ |
6182 | static unsigned long __meminit zone_absent_pages_in_node(int nid, | 6182 | static unsigned long __init zone_absent_pages_in_node(int nid, |
6183 | unsigned long zone_type, | 6183 | unsigned long zone_type, |
6184 | unsigned long node_start_pfn, | 6184 | unsigned long node_start_pfn, |
6185 | unsigned long node_end_pfn, | 6185 | unsigned long node_end_pfn, |
@@ -6231,7 +6231,7 @@ static unsigned long __meminit zone_absent_pages_in_node(int nid, | |||
6231 | } | 6231 | } |
6232 | 6232 | ||
6233 | #else /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ | 6233 | #else /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ |
6234 | static inline unsigned long __meminit zone_spanned_pages_in_node(int nid, | 6234 | static inline unsigned long __init zone_spanned_pages_in_node(int nid, |
6235 | unsigned long zone_type, | 6235 | unsigned long zone_type, |
6236 | unsigned long node_start_pfn, | 6236 | unsigned long node_start_pfn, |
6237 | unsigned long node_end_pfn, | 6237 | unsigned long node_end_pfn, |
@@ -6250,7 +6250,7 @@ static inline unsigned long __meminit zone_spanned_pages_in_node(int nid, | |||
6250 | return zones_size[zone_type]; | 6250 | return zones_size[zone_type]; |
6251 | } | 6251 | } |
6252 | 6252 | ||
6253 | static inline unsigned long __meminit zone_absent_pages_in_node(int nid, | 6253 | static inline unsigned long __init zone_absent_pages_in_node(int nid, |
6254 | unsigned long zone_type, | 6254 | unsigned long zone_type, |
6255 | unsigned long node_start_pfn, | 6255 | unsigned long node_start_pfn, |
6256 | unsigned long node_end_pfn, | 6256 | unsigned long node_end_pfn, |
@@ -6264,7 +6264,7 @@ static inline unsigned long __meminit zone_absent_pages_in_node(int nid, | |||
6264 | 6264 | ||
6265 | #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ | 6265 | #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ |
6266 | 6266 | ||
6267 | static void __meminit calculate_node_totalpages(struct pglist_data *pgdat, | 6267 | static void __init calculate_node_totalpages(struct pglist_data *pgdat, |
6268 | unsigned long node_start_pfn, | 6268 | unsigned long node_start_pfn, |
6269 | unsigned long node_end_pfn, | 6269 | unsigned long node_end_pfn, |
6270 | unsigned long *zones_size, | 6270 | unsigned long *zones_size, |