diff options
author | Pavel Tatashin <pasha.tatashin@oracle.com> | 2018-08-22 00:53:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-08-22 13:52:45 -0400 |
commit | 7cc2a9596d77e598a476ec7819046a453378d4a6 (patch) | |
tree | 50c7d497a53ad325de4c02848085067617eddaab | |
parent | c1093b746c0576ed81c4d568d1e39cab651d37e6 (diff) |
mm: remove __paginginit
__paginginit is the same thing as __meminit except for platforms without
sparsemem, there it is defined as __init.
Remove __paginginit and use __meminit. Use __ref in one single function
that merges __meminit and __init sections: setup_usemap().
Link: http://lkml.kernel.org/r/20180801122348.21588-4-osalvador@techadventures.net
Signed-off-by: Pavel Tatashin <pasha.tatashin@oracle.com>
Signed-off-by: Oscar Salvador <osalvador@suse.de>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Cc: Pasha Tatashin <Pavel.Tatashin@microsoft.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | mm/internal.h | 12 | ||||
-rw-r--r-- | mm/page_alloc.c | 19 |
2 files changed, 10 insertions, 21 deletions
diff --git a/mm/internal.h b/mm/internal.h index 9e3654d70289..dab088cb6937 100644 --- a/mm/internal.h +++ b/mm/internal.h | |||
@@ -389,18 +389,6 @@ static inline struct page *mem_map_next(struct page *iter, | |||
389 | return iter + 1; | 389 | return iter + 1; |
390 | } | 390 | } |
391 | 391 | ||
392 | /* | ||
393 | * FLATMEM and DISCONTIGMEM configurations use alloc_bootmem_node, | ||
394 | * so all functions starting at paging_init should be marked __init | ||
395 | * in those cases. SPARSEMEM, however, allows for memory hotplug, | ||
396 | * and alloc_bootmem_node is not used. | ||
397 | */ | ||
398 | #ifdef CONFIG_SPARSEMEM | ||
399 | #define __paginginit __meminit | ||
400 | #else | ||
401 | #define __paginginit __init | ||
402 | #endif | ||
403 | |||
404 | /* Memory initialisation debug and verification */ | 392 | /* Memory initialisation debug and verification */ |
405 | enum mminit_level { | 393 | enum mminit_level { |
406 | MMINIT_WARNING, | 394 | MMINIT_WARNING, |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 6b2324bc61db..98fe3b68f209 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -6120,7 +6120,7 @@ static unsigned long __init usemap_size(unsigned long zone_start_pfn, unsigned l | |||
6120 | return usemapsize / 8; | 6120 | return usemapsize / 8; |
6121 | } | 6121 | } |
6122 | 6122 | ||
6123 | static void __init setup_usemap(struct pglist_data *pgdat, | 6123 | static void __ref setup_usemap(struct pglist_data *pgdat, |
6124 | struct zone *zone, | 6124 | struct zone *zone, |
6125 | unsigned long zone_start_pfn, | 6125 | unsigned long zone_start_pfn, |
6126 | unsigned long zonesize) | 6126 | unsigned long zonesize) |
@@ -6140,7 +6140,7 @@ static inline void setup_usemap(struct pglist_data *pgdat, struct zone *zone, | |||
6140 | #ifdef CONFIG_HUGETLB_PAGE_SIZE_VARIABLE | 6140 | #ifdef CONFIG_HUGETLB_PAGE_SIZE_VARIABLE |
6141 | 6141 | ||
6142 | /* Initialise the number of pages represented by NR_PAGEBLOCK_BITS */ | 6142 | /* Initialise the number of pages represented by NR_PAGEBLOCK_BITS */ |
6143 | void __paginginit set_pageblock_order(void) | 6143 | void __meminit set_pageblock_order(void) |
6144 | { | 6144 | { |
6145 | unsigned int order; | 6145 | unsigned int order; |
6146 | 6146 | ||
@@ -6168,14 +6168,14 @@ void __paginginit set_pageblock_order(void) | |||
6168 | * include/linux/pageblock-flags.h for the values of pageblock_order based on | 6168 | * include/linux/pageblock-flags.h for the values of pageblock_order based on |
6169 | * the kernel config | 6169 | * the kernel config |
6170 | */ | 6170 | */ |
6171 | void __paginginit set_pageblock_order(void) | 6171 | void __meminit set_pageblock_order(void) |
6172 | { | 6172 | { |
6173 | } | 6173 | } |
6174 | 6174 | ||
6175 | #endif /* CONFIG_HUGETLB_PAGE_SIZE_VARIABLE */ | 6175 | #endif /* CONFIG_HUGETLB_PAGE_SIZE_VARIABLE */ |
6176 | 6176 | ||
6177 | static unsigned long __paginginit calc_memmap_size(unsigned long spanned_pages, | 6177 | static unsigned long __meminit calc_memmap_size(unsigned long spanned_pages, |
6178 | unsigned long present_pages) | 6178 | unsigned long present_pages) |
6179 | { | 6179 | { |
6180 | unsigned long pages = spanned_pages; | 6180 | unsigned long pages = spanned_pages; |
6181 | 6181 | ||
@@ -6233,7 +6233,7 @@ static void pgdat_init_kcompactd(struct pglist_data *pgdat) {} | |||
6233 | * | 6233 | * |
6234 | * NOTE: pgdat should get zeroed by caller. | 6234 | * NOTE: pgdat should get zeroed by caller. |
6235 | */ | 6235 | */ |
6236 | static void __paginginit free_area_init_core(struct pglist_data *pgdat) | 6236 | static void __meminit free_area_init_core(struct pglist_data *pgdat) |
6237 | { | 6237 | { |
6238 | enum zone_type j; | 6238 | enum zone_type j; |
6239 | int nid = pgdat->node_id; | 6239 | int nid = pgdat->node_id; |
@@ -6364,8 +6364,9 @@ static void __ref alloc_node_mem_map(struct pglist_data *pgdat) | |||
6364 | static void __ref alloc_node_mem_map(struct pglist_data *pgdat) { } | 6364 | static void __ref alloc_node_mem_map(struct pglist_data *pgdat) { } |
6365 | #endif /* CONFIG_FLAT_NODE_MEM_MAP */ | 6365 | #endif /* CONFIG_FLAT_NODE_MEM_MAP */ |
6366 | 6366 | ||
6367 | void __paginginit free_area_init_node(int nid, unsigned long *zones_size, | 6367 | void __meminit free_area_init_node(int nid, unsigned long *zones_size, |
6368 | unsigned long node_start_pfn, unsigned long *zholes_size) | 6368 | unsigned long node_start_pfn, |
6369 | unsigned long *zholes_size) | ||
6369 | { | 6370 | { |
6370 | pg_data_t *pgdat = NODE_DATA(nid); | 6371 | pg_data_t *pgdat = NODE_DATA(nid); |
6371 | unsigned long start_pfn = 0; | 6372 | unsigned long start_pfn = 0; |
@@ -6410,7 +6411,7 @@ void __paginginit free_area_init_node(int nid, unsigned long *zones_size, | |||
6410 | * may be accessed (for example page_to_pfn() on some configuration accesses | 6411 | * may be accessed (for example page_to_pfn() on some configuration accesses |
6411 | * flags). We must explicitly zero those struct pages. | 6412 | * flags). We must explicitly zero those struct pages. |
6412 | */ | 6413 | */ |
6413 | void __paginginit zero_resv_unavail(void) | 6414 | void __meminit zero_resv_unavail(void) |
6414 | { | 6415 | { |
6415 | phys_addr_t start, end; | 6416 | phys_addr_t start, end; |
6416 | unsigned long pfn; | 6417 | unsigned long pfn; |