Skip to content

Commit

Permalink
mm: move mem_init_print_info() into mm_init()
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Kefeng Wang <[email protected]>
Acked-by: Dave Hansen <[email protected]>	[x86]
Reviewed-by: Christophe Leroy <[email protected]>	[powerpc]
Acked-by: David Hildenbrand <[email protected]>
Tested-by: Anatoly Pugachev <[email protected]>	[sparc64]
Acked-by: Russell King <[email protected]>	[arm]
Acked-by: Mike Rapoport <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: Guo Ren <[email protected]>
Cc: Yoshinori Sato <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: Jonas Bonn <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: Heiko Carstens <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: "Peter Zijlstra" <[email protected]>
Cc: Ingo Molnar <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Kefeng Wang authored and torvalds committed Apr 30, 2021
1 parent e2b5bcf commit 1f9d03c
Show file tree
Hide file tree
Showing 30 changed files with 7 additions and 42 deletions.
1 change: 0 additions & 1 deletion arch/alpha/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,5 +282,4 @@ mem_init(void)
set_max_mapnr(max_low_pfn);
high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);
memblock_free_all();
mem_init_print_info(NULL);
}
1 change: 0 additions & 1 deletion arch/arc/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ void __init mem_init(void)
{
memblock_free_all();
highmem_init();
mem_init_print_info(NULL);
}

#ifdef CONFIG_HIGHMEM
Expand Down
2 changes: 0 additions & 2 deletions arch/arm/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,6 @@ void __init mem_init(void)

free_highpages();

mem_init_print_info(NULL);

/*
* Check boundaries twice: Some fundamental inconsistencies can
* be detected at build time already.
Expand Down
2 changes: 0 additions & 2 deletions arch/arm64/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,6 @@ void __init mem_init(void)
/* this will put all unused low memory onto the freelists */
memblock_free_all();

mem_init_print_info(NULL);

/*
* Check boundaries twice: Some fundamental inconsistencies can be
* detected at build time already.
Expand Down
1 change: 0 additions & 1 deletion arch/csky/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ void __init mem_init(void)
free_highmem_page(page);
}
#endif
mem_init_print_info(NULL);
}

void free_initmem(void)
Expand Down
2 changes: 0 additions & 2 deletions arch/h8300/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,4 @@ void __init mem_init(void)

/* this will put all low memory onto the freelists */
memblock_free_all();

mem_init_print_info(NULL);
}
1 change: 0 additions & 1 deletion arch/hexagon/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ void __init mem_init(void)
{
/* No idea where this is actually declared. Seems to evade LXR. */
memblock_free_all();
mem_init_print_info(NULL);

/*
* To-Do: someone somewhere should wipe out the bootmem map
Expand Down
1 change: 0 additions & 1 deletion arch/ia64/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ mem_init (void)
set_max_mapnr(max_low_pfn);
high_memory = __va(max_low_pfn * PAGE_SIZE);
memblock_free_all();
mem_init_print_info(NULL);

/*
* For fsyscall entrpoints with no light-weight handler, use the ordinary
Expand Down
1 change: 0 additions & 1 deletion arch/m68k/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,4 @@ void __init mem_init(void)
/* this will put all memory onto the freelists */
memblock_free_all();
init_pointer_tables();
mem_init_print_info(NULL);
}
1 change: 0 additions & 1 deletion arch/microblaze/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ void __init mem_init(void)
highmem_setup();
#endif

mem_init_print_info(NULL);
mem_init_done = 1;
}

Expand Down
1 change: 0 additions & 1 deletion arch/mips/loongson64/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ void __init mem_init(void)
high_memory = (void *) __va(get_num_physpages() << PAGE_SHIFT);
memblock_free_all();
setup_zero_pages(); /* This comes from node 0 */
mem_init_print_info(NULL);
}

/* All PCI device belongs to logical Node-0 */
Expand Down
1 change: 0 additions & 1 deletion arch/mips/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,6 @@ void __init mem_init(void)
memblock_free_all();
setup_zero_pages(); /* Setup zeroed pages. */
mem_init_free_highmem();
mem_init_print_info(NULL);

#ifdef CONFIG_64BIT
if ((unsigned long) &_text > (unsigned long) CKSEG0)
Expand Down
1 change: 0 additions & 1 deletion arch/mips/sgi-ip27/ip27-memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,5 +420,4 @@ void __init mem_init(void)
high_memory = (void *) __va(get_num_physpages() << PAGE_SHIFT);
memblock_free_all();
setup_zero_pages(); /* This comes from node 0 */
mem_init_print_info(NULL);
}
1 change: 0 additions & 1 deletion arch/nds32/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ void __init mem_init(void)

/* this will put all low memory onto the freelists */
memblock_free_all();
mem_init_print_info(NULL);

pr_info("virtual kernel memory layout:\n"
" fixmap : 0x%08lx - 0x%08lx (%4ld kB)\n"
Expand Down
1 change: 0 additions & 1 deletion arch/nios2/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ void __init mem_init(void)

/* this will put all memory onto the freelists */
memblock_free_all();
mem_init_print_info(NULL);
}

void __init mmu_init(void)
Expand Down
2 changes: 0 additions & 2 deletions arch/openrisc/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,6 @@ void __init mem_init(void)
/* this will put all low memory onto the freelists */
memblock_free_all();

mem_init_print_info(NULL);

printk("mem_init_done ...........................................\n");
mem_init_done = 1;
return;
Expand Down
2 changes: 0 additions & 2 deletions arch/parisc/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,6 @@ void __init mem_init(void)
#endif
parisc_vmalloc_start = SET_MAP_OFFSET(MAP_START);

mem_init_print_info(NULL);

#if 0
/*
* Do not expose the virtual kernel memory layout to userspace.
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/mm/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ void __init mem_init(void)
(mfspr(SPRN_TLB1CFG) & TLBnCFG_N_ENTRY) - 1;
#endif

mem_init_print_info(NULL);
#ifdef CONFIG_PPC32
pr_info("Kernel virtual memory layout:\n");
#ifdef CONFIG_KASAN
Expand Down
1 change: 0 additions & 1 deletion arch/riscv/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ void __init mem_init(void)
high_memory = (void *)(__va(PFN_PHYS(max_low_pfn)));
memblock_free_all();

mem_init_print_info(NULL);
print_vm_layout();
}

Expand Down
2 changes: 0 additions & 2 deletions arch/s390/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,6 @@ void __init mem_init(void)
setup_zero_pages(); /* Setup zeroed pages. */

cmma_init_nodat();

mem_init_print_info(NULL);
}

void free_initmem(void)
Expand Down
1 change: 0 additions & 1 deletion arch/sh/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,6 @@ void __init mem_init(void)

vsyscall_init();

mem_init_print_info(NULL);
pr_info("virtual kernel memory layout:\n"
" fixmap : 0x%08lx - 0x%08lx (%4ld kB)\n"
" vmalloc : 0x%08lx - 0x%08lx (%4ld MB)\n"
Expand Down
2 changes: 0 additions & 2 deletions arch/sparc/mm/init_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,6 @@ void __init mem_init(void)

map_high_region(start_pfn, end_pfn);
}

mem_init_print_info(NULL);
}

void sparc_flush_page_to_ram(struct page *page)
Expand Down
1 change: 0 additions & 1 deletion arch/sparc/mm/init_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -2520,7 +2520,6 @@ void __init mem_init(void)
}
mark_page_reserved(mem_map_zero);

mem_init_print_info(NULL);

if (tlb_type == cheetah || tlb_type == cheetah_plus)
cheetah_ecache_flush_init();
Expand Down
1 change: 0 additions & 1 deletion arch/um/kernel/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ void __init mem_init(void)
memblock_free_all();
max_low_pfn = totalram_pages();
max_pfn = max_low_pfn;
mem_init_print_info(NULL);
kmalloc_ok = 1;
}

Expand Down
2 changes: 0 additions & 2 deletions arch/x86/mm/init_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -755,8 +755,6 @@ void __init mem_init(void)
after_bootmem = 1;
x86_init.hyper.init_after_bootmem();

mem_init_print_info(NULL);

/*
* Check boundaries twice: Some fundamental inconsistencies can
* be detected at build time already.
Expand Down
2 changes: 0 additions & 2 deletions arch/x86/mm/init_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -1351,8 +1351,6 @@ void __init mem_init(void)
kclist_add(&kcore_vsyscall, (void *)VSYSCALL_ADDR, PAGE_SIZE, KCORE_USER);

preallocate_vmalloc_pages();

mem_init_print_info(NULL);
}

#ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT
Expand Down
1 change: 0 additions & 1 deletion arch/xtensa/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ void __init mem_init(void)

memblock_free_all();

mem_init_print_info(NULL);
pr_info("virtual kernel memory layout:\n"
#ifdef CONFIG_KASAN
" kasan : 0x%08lx - 0x%08lx (%5lu MB)\n"
Expand Down
2 changes: 1 addition & 1 deletion include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -2360,7 +2360,7 @@ extern unsigned long free_reserved_area(void *start, void *end,
int poison, const char *s);

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);

Expand Down
1 change: 1 addition & 0 deletions init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,7 @@ static void __init mm_init(void)
report_meminit();
stack_depot_init();
mem_init();
mem_init_print_info();
/* page_owner must be initialized after buddy is ready */
page_ext_init_flatmem_late();
kmem_cache_init();
Expand Down
10 changes: 5 additions & 5 deletions mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -7734,7 +7734,7 @@ unsigned long free_reserved_area(void *start, void *end, int poison, const char
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 init_code_size, init_data_size;
Expand Down Expand Up @@ -7773,17 +7773,17 @@ void __init mem_init_print_info(const char *str)
#ifdef CONFIG_HIGHMEM
", %luK highmem"
#endif
"%s%s)\n",
")\n",
nr_free_pages() << (PAGE_SHIFT - 10),
physpages << (PAGE_SHIFT - 10),
codesize >> 10, datasize >> 10, rosize >> 10,
(init_data_size + init_code_size) >> 10, bss_size >> 10,
(physpages - totalram_pages() - totalcma_pages) << (PAGE_SHIFT - 10),
totalcma_pages << (PAGE_SHIFT - 10),
totalcma_pages << (PAGE_SHIFT - 10)
#ifdef CONFIG_HIGHMEM
totalhigh_pages() << (PAGE_SHIFT - 10),
, totalhigh_pages() << (PAGE_SHIFT - 10)
#endif
str ? ", " : "", str ? str : "");
);
}

/**
Expand Down

0 comments on commit 1f9d03c

Please sign in to comment.