mm: move mem_init_print_info() into mm_init()
mem_init_print_info() is called in mem_init() on each architecture, and pass NULL argument, so using void argument and move it into mm_init(). Link: https://lkml.kernel.org/r/20210317015210.33641-1-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Acked-by: Dave Hansen <dave.hansen@linux.intel.com> [x86] Reviewed-by: Christophe Leroy <christophe.leroy@c-s.fr> [powerpc] Acked-by: David Hildenbrand <david@redhat.com> Tested-by: Anatoly Pugachev <matorola@gmail.com> [sparc64] Acked-by: Russell King <rmk+kernel@armlinux.org.uk> [arm] Acked-by: Mike Rapoport <rppt@linux.ibm.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Richard Henderson <rth@twiddle.net> Cc: Guo Ren <guoren@kernel.org> Cc: Yoshinori Sato <ysato@users.osdn.me> Cc: Huacai Chen <chenhuacai@kernel.org> Cc: Jonas Bonn <jonas@southpole.se> Cc: Palmer Dabbelt <palmer@dabbelt.com> Cc: Heiko Carstens <hca@linux.ibm.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: "Peter Zijlstra" <peterz@infradead.org> Cc: Ingo Molnar <mingo@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
e2b5bcf9f5
commit
1f9d03c5e9
@ -282,5 +282,4 @@ mem_init(void)
|
|||||||
set_max_mapnr(max_low_pfn);
|
set_max_mapnr(max_low_pfn);
|
||||||
high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);
|
high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);
|
||||||
memblock_free_all();
|
memblock_free_all();
|
||||||
mem_init_print_info(NULL);
|
|
||||||
}
|
}
|
||||||
|
@ -194,7 +194,6 @@ void __init mem_init(void)
|
|||||||
{
|
{
|
||||||
memblock_free_all();
|
memblock_free_all();
|
||||||
highmem_init();
|
highmem_init();
|
||||||
mem_init_print_info(NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_HIGHMEM
|
#ifdef CONFIG_HIGHMEM
|
||||||
|
@ -316,8 +316,6 @@ void __init mem_init(void)
|
|||||||
|
|
||||||
free_highpages();
|
free_highpages();
|
||||||
|
|
||||||
mem_init_print_info(NULL);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check boundaries twice: Some fundamental inconsistencies can
|
* Check boundaries twice: Some fundamental inconsistencies can
|
||||||
* be detected at build time already.
|
* be detected at build time already.
|
||||||
|
@ -491,8 +491,6 @@ void __init mem_init(void)
|
|||||||
/* this will put all unused low memory onto the freelists */
|
/* this will put all unused low memory onto the freelists */
|
||||||
memblock_free_all();
|
memblock_free_all();
|
||||||
|
|
||||||
mem_init_print_info(NULL);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check boundaries twice: Some fundamental inconsistencies can be
|
* Check boundaries twice: Some fundamental inconsistencies can be
|
||||||
* detected at build time already.
|
* detected at build time already.
|
||||||
|
@ -107,7 +107,6 @@ void __init mem_init(void)
|
|||||||
free_highmem_page(page);
|
free_highmem_page(page);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
mem_init_print_info(NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void free_initmem(void)
|
void free_initmem(void)
|
||||||
|
@ -98,6 +98,4 @@ void __init mem_init(void)
|
|||||||
|
|
||||||
/* this will put all low memory onto the freelists */
|
/* this will put all low memory onto the freelists */
|
||||||
memblock_free_all();
|
memblock_free_all();
|
||||||
|
|
||||||
mem_init_print_info(NULL);
|
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,6 @@ void __init mem_init(void)
|
|||||||
{
|
{
|
||||||
/* No idea where this is actually declared. Seems to evade LXR. */
|
/* No idea where this is actually declared. Seems to evade LXR. */
|
||||||
memblock_free_all();
|
memblock_free_all();
|
||||||
mem_init_print_info(NULL);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* To-Do: someone somewhere should wipe out the bootmem map
|
* To-Do: someone somewhere should wipe out the bootmem map
|
||||||
|
@ -449,7 +449,6 @@ mem_init (void)
|
|||||||
set_max_mapnr(max_low_pfn);
|
set_max_mapnr(max_low_pfn);
|
||||||
high_memory = __va(max_low_pfn * PAGE_SIZE);
|
high_memory = __va(max_low_pfn * PAGE_SIZE);
|
||||||
memblock_free_all();
|
memblock_free_all();
|
||||||
mem_init_print_info(NULL);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For fsyscall entrpoints with no light-weight handler, use the ordinary
|
* For fsyscall entrpoints with no light-weight handler, use the ordinary
|
||||||
|
@ -153,5 +153,4 @@ void __init mem_init(void)
|
|||||||
/* this will put all memory onto the freelists */
|
/* this will put all memory onto the freelists */
|
||||||
memblock_free_all();
|
memblock_free_all();
|
||||||
init_pointer_tables();
|
init_pointer_tables();
|
||||||
mem_init_print_info(NULL);
|
|
||||||
}
|
}
|
||||||
|
@ -131,7 +131,6 @@ void __init mem_init(void)
|
|||||||
highmem_setup();
|
highmem_setup();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mem_init_print_info(NULL);
|
|
||||||
mem_init_done = 1;
|
mem_init_done = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,7 +178,6 @@ void __init mem_init(void)
|
|||||||
high_memory = (void *) __va(get_num_physpages() << PAGE_SHIFT);
|
high_memory = (void *) __va(get_num_physpages() << PAGE_SHIFT);
|
||||||
memblock_free_all();
|
memblock_free_all();
|
||||||
setup_zero_pages(); /* This comes from node 0 */
|
setup_zero_pages(); /* This comes from node 0 */
|
||||||
mem_init_print_info(NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* All PCI device belongs to logical Node-0 */
|
/* All PCI device belongs to logical Node-0 */
|
||||||
|
@ -467,7 +467,6 @@ void __init mem_init(void)
|
|||||||
memblock_free_all();
|
memblock_free_all();
|
||||||
setup_zero_pages(); /* Setup zeroed pages. */
|
setup_zero_pages(); /* Setup zeroed pages. */
|
||||||
mem_init_free_highmem();
|
mem_init_free_highmem();
|
||||||
mem_init_print_info(NULL);
|
|
||||||
|
|
||||||
#ifdef CONFIG_64BIT
|
#ifdef CONFIG_64BIT
|
||||||
if ((unsigned long) &_text > (unsigned long) CKSEG0)
|
if ((unsigned long) &_text > (unsigned long) CKSEG0)
|
||||||
|
@ -420,5 +420,4 @@ void __init mem_init(void)
|
|||||||
high_memory = (void *) __va(get_num_physpages() << PAGE_SHIFT);
|
high_memory = (void *) __va(get_num_physpages() << PAGE_SHIFT);
|
||||||
memblock_free_all();
|
memblock_free_all();
|
||||||
setup_zero_pages(); /* This comes from node 0 */
|
setup_zero_pages(); /* This comes from node 0 */
|
||||||
mem_init_print_info(NULL);
|
|
||||||
}
|
}
|
||||||
|
@ -191,7 +191,6 @@ void __init mem_init(void)
|
|||||||
|
|
||||||
/* this will put all low memory onto the freelists */
|
/* this will put all low memory onto the freelists */
|
||||||
memblock_free_all();
|
memblock_free_all();
|
||||||
mem_init_print_info(NULL);
|
|
||||||
|
|
||||||
pr_info("virtual kernel memory layout:\n"
|
pr_info("virtual kernel memory layout:\n"
|
||||||
" fixmap : 0x%08lx - 0x%08lx (%4ld kB)\n"
|
" fixmap : 0x%08lx - 0x%08lx (%4ld kB)\n"
|
||||||
|
@ -71,7 +71,6 @@ void __init mem_init(void)
|
|||||||
|
|
||||||
/* this will put all memory onto the freelists */
|
/* this will put all memory onto the freelists */
|
||||||
memblock_free_all();
|
memblock_free_all();
|
||||||
mem_init_print_info(NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void __init mmu_init(void)
|
void __init mmu_init(void)
|
||||||
|
@ -211,8 +211,6 @@ void __init mem_init(void)
|
|||||||
/* this will put all low memory onto the freelists */
|
/* this will put all low memory onto the freelists */
|
||||||
memblock_free_all();
|
memblock_free_all();
|
||||||
|
|
||||||
mem_init_print_info(NULL);
|
|
||||||
|
|
||||||
printk("mem_init_done ...........................................\n");
|
printk("mem_init_done ...........................................\n");
|
||||||
mem_init_done = 1;
|
mem_init_done = 1;
|
||||||
return;
|
return;
|
||||||
|
@ -573,8 +573,6 @@ void __init mem_init(void)
|
|||||||
#endif
|
#endif
|
||||||
parisc_vmalloc_start = SET_MAP_OFFSET(MAP_START);
|
parisc_vmalloc_start = SET_MAP_OFFSET(MAP_START);
|
||||||
|
|
||||||
mem_init_print_info(NULL);
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/*
|
/*
|
||||||
* Do not expose the virtual kernel memory layout to userspace.
|
* Do not expose the virtual kernel memory layout to userspace.
|
||||||
|
@ -312,7 +312,6 @@ void __init mem_init(void)
|
|||||||
(mfspr(SPRN_TLB1CFG) & TLBnCFG_N_ENTRY) - 1;
|
(mfspr(SPRN_TLB1CFG) & TLBnCFG_N_ENTRY) - 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mem_init_print_info(NULL);
|
|
||||||
#ifdef CONFIG_PPC32
|
#ifdef CONFIG_PPC32
|
||||||
pr_info("Kernel virtual memory layout:\n");
|
pr_info("Kernel virtual memory layout:\n");
|
||||||
#ifdef CONFIG_KASAN
|
#ifdef CONFIG_KASAN
|
||||||
|
@ -102,7 +102,6 @@ void __init mem_init(void)
|
|||||||
high_memory = (void *)(__va(PFN_PHYS(max_low_pfn)));
|
high_memory = (void *)(__va(PFN_PHYS(max_low_pfn)));
|
||||||
memblock_free_all();
|
memblock_free_all();
|
||||||
|
|
||||||
mem_init_print_info(NULL);
|
|
||||||
print_vm_layout();
|
print_vm_layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,8 +209,6 @@ void __init mem_init(void)
|
|||||||
setup_zero_pages(); /* Setup zeroed pages. */
|
setup_zero_pages(); /* Setup zeroed pages. */
|
||||||
|
|
||||||
cmma_init_nodat();
|
cmma_init_nodat();
|
||||||
|
|
||||||
mem_init_print_info(NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void free_initmem(void)
|
void free_initmem(void)
|
||||||
|
@ -359,7 +359,6 @@ void __init mem_init(void)
|
|||||||
|
|
||||||
vsyscall_init();
|
vsyscall_init();
|
||||||
|
|
||||||
mem_init_print_info(NULL);
|
|
||||||
pr_info("virtual kernel memory layout:\n"
|
pr_info("virtual kernel memory layout:\n"
|
||||||
" fixmap : 0x%08lx - 0x%08lx (%4ld kB)\n"
|
" fixmap : 0x%08lx - 0x%08lx (%4ld kB)\n"
|
||||||
" vmalloc : 0x%08lx - 0x%08lx (%4ld MB)\n"
|
" vmalloc : 0x%08lx - 0x%08lx (%4ld MB)\n"
|
||||||
|
@ -292,8 +292,6 @@ void __init mem_init(void)
|
|||||||
|
|
||||||
map_high_region(start_pfn, end_pfn);
|
map_high_region(start_pfn, end_pfn);
|
||||||
}
|
}
|
||||||
|
|
||||||
mem_init_print_info(NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void sparc_flush_page_to_ram(struct page *page)
|
void sparc_flush_page_to_ram(struct page *page)
|
||||||
|
@ -2520,7 +2520,6 @@ void __init mem_init(void)
|
|||||||
}
|
}
|
||||||
mark_page_reserved(mem_map_zero);
|
mark_page_reserved(mem_map_zero);
|
||||||
|
|
||||||
mem_init_print_info(NULL);
|
|
||||||
|
|
||||||
if (tlb_type == cheetah || tlb_type == cheetah_plus)
|
if (tlb_type == cheetah || tlb_type == cheetah_plus)
|
||||||
cheetah_ecache_flush_init();
|
cheetah_ecache_flush_init();
|
||||||
|
@ -54,7 +54,6 @@ void __init mem_init(void)
|
|||||||
memblock_free_all();
|
memblock_free_all();
|
||||||
max_low_pfn = totalram_pages();
|
max_low_pfn = totalram_pages();
|
||||||
max_pfn = max_low_pfn;
|
max_pfn = max_low_pfn;
|
||||||
mem_init_print_info(NULL);
|
|
||||||
kmalloc_ok = 1;
|
kmalloc_ok = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -755,8 +755,6 @@ void __init mem_init(void)
|
|||||||
after_bootmem = 1;
|
after_bootmem = 1;
|
||||||
x86_init.hyper.init_after_bootmem();
|
x86_init.hyper.init_after_bootmem();
|
||||||
|
|
||||||
mem_init_print_info(NULL);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check boundaries twice: Some fundamental inconsistencies can
|
* Check boundaries twice: Some fundamental inconsistencies can
|
||||||
* be detected at build time already.
|
* be detected at build time already.
|
||||||
|
@ -1351,8 +1351,6 @@ void __init mem_init(void)
|
|||||||
kclist_add(&kcore_vsyscall, (void *)VSYSCALL_ADDR, PAGE_SIZE, KCORE_USER);
|
kclist_add(&kcore_vsyscall, (void *)VSYSCALL_ADDR, PAGE_SIZE, KCORE_USER);
|
||||||
|
|
||||||
preallocate_vmalloc_pages();
|
preallocate_vmalloc_pages();
|
||||||
|
|
||||||
mem_init_print_info(NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT
|
#ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT
|
||||||
|
@ -119,7 +119,6 @@ void __init mem_init(void)
|
|||||||
|
|
||||||
memblock_free_all();
|
memblock_free_all();
|
||||||
|
|
||||||
mem_init_print_info(NULL);
|
|
||||||
pr_info("virtual kernel memory layout:\n"
|
pr_info("virtual kernel memory layout:\n"
|
||||||
#ifdef CONFIG_KASAN
|
#ifdef CONFIG_KASAN
|
||||||
" kasan : 0x%08lx - 0x%08lx (%5lu MB)\n"
|
" kasan : 0x%08lx - 0x%08lx (%5lu MB)\n"
|
||||||
|
@ -2360,7 +2360,7 @@ extern unsigned long free_reserved_area(void *start, void *end,
|
|||||||
int poison, const char *s);
|
int poison, const char *s);
|
||||||
|
|
||||||
extern void adjust_managed_page_count(struct page *page, long count);
|
extern void adjust_managed_page_count(struct page *page, long count);
|
||||||
extern void mem_init_print_info(const char *str);
|
extern void mem_init_print_info(void);
|
||||||
|
|
||||||
extern void reserve_bootmem_region(phys_addr_t start, phys_addr_t end);
|
extern void reserve_bootmem_region(phys_addr_t start, phys_addr_t end);
|
||||||
|
|
||||||
|
@ -830,6 +830,7 @@ static void __init mm_init(void)
|
|||||||
report_meminit();
|
report_meminit();
|
||||||
stack_depot_init();
|
stack_depot_init();
|
||||||
mem_init();
|
mem_init();
|
||||||
|
mem_init_print_info();
|
||||||
/* page_owner must be initialized after buddy is ready */
|
/* page_owner must be initialized after buddy is ready */
|
||||||
page_ext_init_flatmem_late();
|
page_ext_init_flatmem_late();
|
||||||
kmem_cache_init();
|
kmem_cache_init();
|
||||||
|
@ -7734,7 +7734,7 @@ unsigned long free_reserved_area(void *start, void *end, int poison, const char
|
|||||||
return pages;
|
return pages;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __init mem_init_print_info(const char *str)
|
void __init mem_init_print_info(void)
|
||||||
{
|
{
|
||||||
unsigned long physpages, codesize, datasize, rosize, bss_size;
|
unsigned long physpages, codesize, datasize, rosize, bss_size;
|
||||||
unsigned long init_code_size, init_data_size;
|
unsigned long init_code_size, init_data_size;
|
||||||
@ -7773,17 +7773,17 @@ void __init mem_init_print_info(const char *str)
|
|||||||
#ifdef CONFIG_HIGHMEM
|
#ifdef CONFIG_HIGHMEM
|
||||||
", %luK highmem"
|
", %luK highmem"
|
||||||
#endif
|
#endif
|
||||||
"%s%s)\n",
|
")\n",
|
||||||
nr_free_pages() << (PAGE_SHIFT - 10),
|
nr_free_pages() << (PAGE_SHIFT - 10),
|
||||||
physpages << (PAGE_SHIFT - 10),
|
physpages << (PAGE_SHIFT - 10),
|
||||||
codesize >> 10, datasize >> 10, rosize >> 10,
|
codesize >> 10, datasize >> 10, rosize >> 10,
|
||||||
(init_data_size + init_code_size) >> 10, bss_size >> 10,
|
(init_data_size + init_code_size) >> 10, bss_size >> 10,
|
||||||
(physpages - totalram_pages() - totalcma_pages) << (PAGE_SHIFT - 10),
|
(physpages - totalram_pages() - totalcma_pages) << (PAGE_SHIFT - 10),
|
||||||
totalcma_pages << (PAGE_SHIFT - 10),
|
totalcma_pages << (PAGE_SHIFT - 10)
|
||||||
#ifdef CONFIG_HIGHMEM
|
#ifdef CONFIG_HIGHMEM
|
||||||
totalhigh_pages() << (PAGE_SHIFT - 10),
|
, totalhigh_pages() << (PAGE_SHIFT - 10)
|
||||||
#endif
|
#endif
|
||||||
str ? ", " : "", str ? str : "");
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user