mm: use free_area_init() instead of free_area_init_nodes()

free_area_init() has effectively became a wrapper for
free_area_init_nodes() and there is no point of keeping it.  Still
free_area_init() name is shorter and more general as it does not imply
necessity to initialize multiple nodes.

Rename free_area_init_nodes() to free_area_init(), update the callers and
drop old version of free_area_init().

Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Tested-by: Hoan Tran <hoan@os.amperecomputing.com>	[arm64]
Reviewed-by: Baoquan He <bhe@redhat.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Brian Cain <bcain@codeaurora.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Greentime Hu <green.hu@gmail.com>
Cc: Greg Ungerer <gerg@linux-m68k.org>
Cc: Guan Xuetao <gxt@pku.edu.cn>
Cc: Guo Ren <guoren@kernel.org>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Helge Deller <deller@gmx.de>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Ley Foon Tan <ley.foon.tan@intel.com>
Cc: Mark Salter <msalter@redhat.com>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Nick Hu <nickhu@andestech.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Rich Felker <dalias@libc.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Stafford Horne <shorne@gmail.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Link: http://lkml.kernel.org/r/20200412194859.12663-6-rppt@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Mike Rapoport 2020-06-03 15:57:10 -07:00 committed by Linus Torvalds
parent fa3354e4ea
commit 9691a071aa
15 changed files with 18 additions and 25 deletions

View File

@ -206,7 +206,7 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max)
#endif #endif
max_zone_pfns[ZONE_NORMAL] = max; max_zone_pfns[ZONE_NORMAL] = max;
free_area_init_nodes(max_zone_pfns); free_area_init(max_zone_pfns);
} }
#else #else

View File

@ -210,6 +210,6 @@ paging_init (void)
printk("Virtual mem_map starts at 0x%p\n", mem_map); printk("Virtual mem_map starts at 0x%p\n", mem_map);
} }
#endif /* !CONFIG_VIRTUAL_MEM_MAP */ #endif /* !CONFIG_VIRTUAL_MEM_MAP */
free_area_init_nodes(max_zone_pfns); free_area_init(max_zone_pfns);
zero_page_memmap_ptr = virt_to_page(ia64_imva(empty_zero_page)); zero_page_memmap_ptr = virt_to_page(ia64_imva(empty_zero_page));
} }

View File

@ -627,7 +627,7 @@ void __init paging_init(void)
max_zone_pfns[ZONE_DMA32] = max_dma; max_zone_pfns[ZONE_DMA32] = max_dma;
#endif #endif
max_zone_pfns[ZONE_NORMAL] = max_pfn; max_zone_pfns[ZONE_NORMAL] = max_pfn;
free_area_init_nodes(max_zone_pfns); free_area_init(max_zone_pfns);
zero_page_memmap_ptr = virt_to_page(ia64_imva(empty_zero_page)); zero_page_memmap_ptr = virt_to_page(ia64_imva(empty_zero_page));
} }

View File

@ -112,7 +112,7 @@ static void __init paging_init(void)
#endif #endif
/* We don't have holes in memory map */ /* We don't have holes in memory map */
free_area_init_nodes(zones_size); free_area_init(zones_size);
} }
void __init setup_memory(void) void __init setup_memory(void)

View File

@ -247,7 +247,7 @@ void __init paging_init(void)
zones_size[ZONE_DMA32] = MAX_DMA32_PFN; zones_size[ZONE_DMA32] = MAX_DMA32_PFN;
#endif #endif
zones_size[ZONE_NORMAL] = max_low_pfn; zones_size[ZONE_NORMAL] = max_low_pfn;
free_area_init_nodes(zones_size); free_area_init(zones_size);
} }
void __init mem_init(void) void __init mem_init(void)

View File

@ -418,7 +418,7 @@ void __init paging_init(void)
} }
#endif #endif
free_area_init_nodes(max_zone_pfns); free_area_init(max_zone_pfns);
} }
#ifdef CONFIG_64BIT #ifdef CONFIG_64BIT

View File

@ -419,7 +419,7 @@ void __init paging_init(void)
pagetable_init(); pagetable_init();
zones_size[ZONE_NORMAL] = max_low_pfn; zones_size[ZONE_NORMAL] = max_low_pfn;
free_area_init_nodes(zones_size); free_area_init(zones_size);
} }
void __init mem_init(void) void __init mem_init(void)

View File

@ -271,7 +271,7 @@ void __init paging_init(void)
max_zone_pfns[ZONE_HIGHMEM] = max_pfn; max_zone_pfns[ZONE_HIGHMEM] = max_pfn;
#endif #endif
free_area_init_nodes(max_zone_pfns); free_area_init(max_zone_pfns);
mark_nonram_nosave(); mark_nonram_nosave();
} }

View File

@ -39,7 +39,7 @@ static void __init zone_sizes_init(void)
#endif #endif
max_zone_pfns[ZONE_NORMAL] = max_low_pfn; max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
free_area_init_nodes(max_zone_pfns); free_area_init(max_zone_pfns);
} }
static void setup_zero_page(void) static void setup_zero_page(void)

View File

@ -122,7 +122,7 @@ void __init paging_init(void)
memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
max_zone_pfns[ZONE_DMA] = PFN_DOWN(MAX_DMA_ADDRESS); max_zone_pfns[ZONE_DMA] = PFN_DOWN(MAX_DMA_ADDRESS);
max_zone_pfns[ZONE_NORMAL] = max_low_pfn; max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
free_area_init_nodes(max_zone_pfns); free_area_init(max_zone_pfns);
} }
void mark_rodata_ro(void) void mark_rodata_ro(void)

View File

@ -334,7 +334,7 @@ void __init paging_init(void)
memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
max_zone_pfns[ZONE_NORMAL] = max_low_pfn; max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
free_area_init_nodes(max_zone_pfns); free_area_init(max_zone_pfns);
} }
unsigned int mem_init_done = 0; unsigned int mem_init_done = 0;

View File

@ -2488,7 +2488,7 @@ void __init paging_init(void)
max_zone_pfns[ZONE_NORMAL] = end_pfn; max_zone_pfns[ZONE_NORMAL] = end_pfn;
free_area_init_nodes(max_zone_pfns); free_area_init(max_zone_pfns);
} }
printk("Booting Linux...\n"); printk("Booting Linux...\n");

View File

@ -947,7 +947,7 @@ void __init zone_sizes_init(void)
max_zone_pfns[ZONE_HIGHMEM] = max_pfn; max_zone_pfns[ZONE_HIGHMEM] = max_pfn;
#endif #endif
free_area_init_nodes(max_zone_pfns); free_area_init(max_zone_pfns);
} }
__visible DEFINE_PER_CPU_SHARED_ALIGNED(struct tlb_state, cpu_tlbstate) = { __visible DEFINE_PER_CPU_SHARED_ALIGNED(struct tlb_state, cpu_tlbstate) = {

View File

@ -2329,7 +2329,6 @@ static inline spinlock_t *pud_lock(struct mm_struct *mm, pud_t *pud)
} }
extern void __init pagecache_init(void); extern void __init pagecache_init(void);
extern void free_area_init(unsigned long * max_zone_pfn);
extern void __init free_area_init_node(int nid, unsigned long * zones_size, extern void __init free_area_init_node(int nid, unsigned long * zones_size,
unsigned long zone_start_pfn, unsigned long *zholes_size); unsigned long zone_start_pfn, unsigned long *zholes_size);
extern void free_initmem(void); extern void free_initmem(void);
@ -2410,21 +2409,21 @@ static inline unsigned long get_num_physpages(void)
* *
* An architecture is expected to register range of page frames backed by * An architecture is expected to register range of page frames backed by
* physical memory with memblock_add[_node]() before calling * physical memory with memblock_add[_node]() before calling
* free_area_init_nodes() passing in the PFN each zone ends at. At a basic * free_area_init() passing in the PFN each zone ends at. At a basic
* usage, an architecture is expected to do something like * usage, an architecture is expected to do something like
* *
* unsigned long max_zone_pfns[MAX_NR_ZONES] = {max_dma, max_normal_pfn, * unsigned long max_zone_pfns[MAX_NR_ZONES] = {max_dma, max_normal_pfn,
* max_highmem_pfn}; * max_highmem_pfn};
* for_each_valid_physical_page_range() * for_each_valid_physical_page_range()
* memblock_add_node(base, size, nid) * memblock_add_node(base, size, nid)
* free_area_init_nodes(max_zone_pfns); * free_area_init(max_zone_pfns);
* *
* free_bootmem_with_active_regions() calls free_bootmem_node() for each * free_bootmem_with_active_regions() calls free_bootmem_node() for each
* registered physical page range. Similarly * registered physical page range. Similarly
* sparse_memory_present_with_active_regions() calls memory_present() for * sparse_memory_present_with_active_regions() calls memory_present() for
* each range when SPARSEMEM is enabled. * each range when SPARSEMEM is enabled.
*/ */
extern void free_area_init_nodes(unsigned long *max_zone_pfn); void free_area_init(unsigned long *max_zone_pfn);
unsigned long node_map_pfn_alignment(void); unsigned long node_map_pfn_alignment(void);
unsigned long __absent_pages_in_range(int nid, unsigned long start_pfn, unsigned long __absent_pages_in_range(int nid, unsigned long start_pfn,
unsigned long end_pfn); unsigned long end_pfn);

View File

@ -7440,7 +7440,7 @@ static void check_for_memory(pg_data_t *pgdat, int nid)
} }
/** /**
* free_area_init_nodes - Initialise all pg_data_t and zone data * free_area_init - Initialise all pg_data_t and zone data
* @max_zone_pfn: an array of max PFNs for each zone * @max_zone_pfn: an array of max PFNs for each zone
* *
* This will call free_area_init_node() for each active node in the system. * This will call free_area_init_node() for each active node in the system.
@ -7452,7 +7452,7 @@ static void check_for_memory(pg_data_t *pgdat, int nid)
* starts where the previous one ended. For example, ZONE_DMA32 starts * starts where the previous one ended. For example, ZONE_DMA32 starts
* at arch_max_dma_pfn. * at arch_max_dma_pfn.
*/ */
void __init free_area_init_nodes(unsigned long *max_zone_pfn) void __init free_area_init(unsigned long *max_zone_pfn)
{ {
unsigned long start_pfn, end_pfn; unsigned long start_pfn, end_pfn;
int i, nid; int i, nid;
@ -7712,12 +7712,6 @@ void __init set_dma_reserve(unsigned long new_dma_reserve)
dma_reserve = new_dma_reserve; dma_reserve = new_dma_reserve;
} }
void __init free_area_init(unsigned long *max_zone_pfn)
{
init_unavailable_mem();
free_area_init_nodes(max_zone_pfn);
}
static int page_alloc_cpu_dead(unsigned int cpu) static int page_alloc_cpu_dead(unsigned int cpu)
{ {