mm: Move mem_init_print_info() into mm_init()
Subsystems (26)
PATCH 1/1 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, cleanup it by using void argument and move it into mm_init().
--- arch/alpha/mm/init.c | 1 - arch/arc/mm/init.c | 1 - arch/arm/mm/init.c | 2 -- arch/arm64/mm/init.c | 2 -- arch/csky/mm/init.c | 1 - arch/h8300/mm/init.c | 2 -- arch/hexagon/mm/init.c | 1 - arch/ia64/mm/init.c | 1 - arch/m68k/mm/init.c | 1 - arch/microblaze/mm/init.c | 1 - arch/mips/loongson64/numa.c | 1 - arch/mips/mm/init.c | 1 - arch/mips/sgi-ip27/ip27-memory.c | 1 - arch/nds32/mm/init.c | 1 - arch/nios2/mm/init.c | 1 - arch/openrisc/mm/init.c | 2 -- arch/parisc/mm/init.c | 2 -- arch/powerpc/mm/mem.c | 1 - arch/riscv/mm/init.c | 1 - arch/s390/mm/init.c | 2 -- arch/sh/mm/init.c | 1 - arch/sparc/mm/init_32.c | 2 -- arch/sparc/mm/init_64.c | 1 - arch/um/kernel/mem.c | 1 - arch/x86/mm/init_32.c | 2 -- arch/x86/mm/init_64.c | 2 -- arch/xtensa/mm/init.c | 1 - include/linux/mm.h | 2 +- init/main.c | 1 + mm/page_alloc.c | 2 +- 30 files changed, 3 insertions(+), 38 deletions(-)
arch/alpha/mm/init.c +0 -1
@@ -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 ); }
arch/arc/mm/init.c +0 -1
@@ -194,7 +194,6 @@ void __init mem_init(void) {memblock_free_all ();highmem_init (); -mem_init_print_info (NULL ); }#ifdef CONFIG_HIGHMEM
arch/arm/mm/init.c +0 -2
@@ -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.
arch/arm64/mm/init.c +0 -2
@@ -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.
arch/csky/mm/init.c +0 -1
@@ -107,7 +107,6 @@ void __init mem_init(void) free_highmem_page(page); }#endif -mem_init_print_info (NULL ); }void free_initmem (void )
arch/h8300/mm/init.c +0 -2
@@ -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 ); }
arch/hexagon/mm/init.c +0 -1
@@ -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
arch/ia64/mm/init.c +0 -1
@@ -659,7 +659,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
arch/m68k/mm/init.c +0 -1
@@ -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 ); }
arch/microblaze/mm/init.c +0 -1
@@ -131,7 +131,6 @@ void __init mem_init(void)highmem_setup ();#endif -mem_init_print_info (NULL ); mem_init_done =1 ; }
arch/mips/loongson64/numa.c +0 -1
@@ -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 */
arch/mips/mm/init.c +0 -1
@@ -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 )
arch/mips/sgi-ip27/ip27-memory.c +0 -1
@@ -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 ); }
arch/nds32/mm/init.c +0 -1
@@ -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"
arch/nios2/mm/init.c +0 -1
@@ -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 )
arch/openrisc/mm/init.c +0 -2
@@ -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 ;
arch/parisc/mm/init.c +0 -2
@@ -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.
arch/powerpc/mm/mem.c +0 -1
@@ -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
arch/riscv/mm/init.c +0 -1
@@ -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 (); }
arch/s390/mm/init.c +0 -2
@@ -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 )
arch/sh/mm/init.c +0 -1
@@ -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"
arch/sparc/mm/init_32.c +0 -2
@@ -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)
arch/sparc/mm/init_64.c +0 -1
@@ -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 ();
arch/um/kernel/mem.c +0 -1
@@ -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 ; }
arch/x86/mm/init_32.c +0 -2
@@ -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.
arch/x86/mm/init_64.c +0 -2
@@ -1350,8 +1350,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
arch/xtensa/mm/init.c +0 -1
@@ -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"
include/linux/mm.h +1 -1
@@ -2373,7 +2373,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);
init/main.c +1 -0
@@ -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 ();
mm/page_alloc.c +1 -1
@@ -7728,7 +7728,7 @@ unsigned long free_reserved_area(void *start, void *end, int poison, const charreturn 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;
Signature · 1 line
2.26.2
Le 16/03/2021 à 15:26, Kefeng Wang a écrit :
Quoted 45 lines
mem_init_print_info()is called inmem_init()on each architecture, and pass NULL argument, cleanup it by using void argument and move it intomm_init().Signed-off-by Kefeng Wang <[email protected]>--- arch/alpha/mm/init.c | 1 - arch/arc/mm/init.c | 1 - arch/arm/mm/init.c | 2 -- arch/arm64/mm/init.c | 2 -- arch/csky/mm/init.c | 1 - arch/h8300/mm/init.c | 2 -- arch/hexagon/mm/init.c | 1 - arch/ia64/mm/init.c | 1 - arch/m68k/mm/init.c | 1 - arch/microblaze/mm/init.c | 1 - arch/mips/loongson64/numa.c | 1 - arch/mips/mm/init.c | 1 - arch/mips/sgi-ip27/ip27-memory.c | 1 - arch/nds32/mm/init.c | 1 - arch/nios2/mm/init.c | 1 - arch/openrisc/mm/init.c | 2 -- arch/parisc/mm/init.c | 2 -- arch/powerpc/mm/mem.c | 1 - arch/riscv/mm/init.c | 1 - arch/s390/mm/init.c | 2 -- arch/sh/mm/init.c | 1 - arch/sparc/mm/init_32.c | 2 -- arch/sparc/mm/init_64.c | 1 - arch/um/kernel/mem.c | 1 - arch/x86/mm/init_32.c | 2 -- arch/x86/mm/init_64.c | 2 -- arch/xtensa/mm/init.c | 1 - include/linux/mm.h | 2 +- init/main.c | 1 + mm/page_alloc.c | 2 +- 30 files changed, 3 insertions(+), 38 deletions(-)mm/page_alloc.c +0
-0
mm/page_alloc.c unsigned long free_reserved_area(void *start, void *end, int poison, const char · line 7734
Quoted 8 lines
mm/page_alloc.c +1
-1@@ -7728,7 +7728,7 @@ unsigned long free_reserved_area(void *start, void *end, int poison, const charreturn 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;
And what about the 'str' in the last line of the function ?
pr_info("Memory: %luK/%luK available (%luK kernel code, %luK rwdata, %luK rodata, %luK init, %luK
bss, %luK reserved, %luK cma-reserved"
#ifdef CONFIG_HIGHMEM
", %luK highmem"
#endif "%s%s)\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), #ifdef CONFIG_HIGHMEM totalhigh_pages() << (PAGE_SHIFT - 10), #endif str ? ", " : "", str ? str : "");
Christophe
Quoted 59 lines · Christophe Leroy
Le 16/03/2021 à 15:26, Kefeng Wang a écrit :
Quoted 44 lines
mem_init_print_info()is called inmem_init()on each architecture, and pass NULL argument, cleanup it by using void argument and move it intomm_init().Signed-off-by Kefeng Wang <[email protected]>---
arch/alpha/mm/init.c | 1 -
arch/arc/mm/init.c | 1 -
arch/arm/mm/init.c | 2 --
arch/arm64/mm/init.c | 2 --
arch/csky/mm/init.c | 1 -
arch/h8300/mm/init.c | 2 --
arch/hexagon/mm/init.c | 1 -
arch/ia64/mm/init.c | 1 -
arch/m68k/mm/init.c | 1 -
arch/microblaze/mm/init.c | 1 -
arch/mips/loongson64/numa.c | 1 -
arch/mips/mm/init.c | 1 -
arch/mips/sgi-ip27/ip27-memory.c| 1 -
arch/nds32/mm/init.c | 1 -
arch/nios2/mm/init.c | 1 -
arch/openrisc/mm/init.c | 2 --
arch/parisc/mm/init.c | 2 --
arch/powerpc/mm/mem.c | 1 -
arch/riscv/mm/init.c | 1 -
arch/s390/mm/init.c | 2 --
arch/sh/mm/init.c | 1 -
arch/sparc/mm/init_32.c | 2 --
arch/sparc/mm/init_64.c | 1 -
arch/um/kernel/mem.c | 1 -arch/x86/mm/init_32.c | 2 -- arch/x86/mm/init_64.c | 2 -- arch/xtensa/mm/init.c | 1 - include/linux/mm.h | 2 +- init/main.c | 1 + mm/page_alloc.c | 2 +- 30 files changed, 3 insertions(+), 38 deletions(-)mm/page_alloc.c +0
-0@@ -7728,7 +7728,7 @@ unsigned long free_reserved_area(void *start,Quoted 9 lines
void *end, int poison, const char
return pages;
}
-void__initmem_init_print_info(const char *str)
+void__initmem_init_print_info(void)
{
unsigned long physpages, codesize, datasize, rosize,bss_size; unsigned longinit_code_size,init_data_size;And what about the 'str' in the last line of the function ?
Quoted 16 lines
pr_info("Memory: %luK/%luK available (%luK kernel code, %luK rwdata, %luK rodata, %luK init, %luK bss, %luK reserved, %luK cma-reserved" #ifdef
CONFIG_HIGHMEM
", %luK highmem"
#endif
"%s%s)\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),
#ifdefCONFIG_HIGHMEM
totalhigh_pages()<< (PAGE_SHIFT- 10),
#endif
str ? ", " : "", str ? str : "");
oh, I send a bad version,firstly I want to split two patches, one for function move, one for function change.
sorry, please ignore it, thanks for your remind.
Quoted 5 lines
Christophe
.
PATCH RESEND 1/1 mm: Move mem_init_print_info() into mm_init()
In reply to Kefeng Wangmem_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().
---
Resend with 'str' line cleanup, and only test on ARM64 qemu.
arch/alpha/mm/init.c | 1 - arch/arc/mm/init.c | 1 - arch/arm/mm/init.c | 2 -- arch/arm64/mm/init.c | 2 -- arch/csky/mm/init.c | 1 - arch/h8300/mm/init.c | 2 -- arch/hexagon/mm/init.c | 1 - arch/ia64/mm/init.c | 1 - arch/m68k/mm/init.c | 1 - arch/microblaze/mm/init.c | 1 - arch/mips/loongson64/numa.c | 1 - arch/mips/mm/init.c | 1 - arch/mips/sgi-ip27/ip27-memory.c | 1 - arch/nds32/mm/init.c | 1 - arch/nios2/mm/init.c | 1 - arch/openrisc/mm/init.c | 2 -- arch/parisc/mm/init.c | 2 -- arch/powerpc/mm/mem.c | 1 - arch/riscv/mm/init.c | 1 - arch/s390/mm/init.c | 2 -- arch/sh/mm/init.c | 1 - arch/sparc/mm/init_32.c | 2 -- arch/sparc/mm/init_64.c | 1 - arch/um/kernel/mem.c | 1 - arch/x86/mm/init_32.c | 2 -- arch/x86/mm/init_64.c | 2 -- arch/xtensa/mm/init.c | 1 - include/linux/mm.h | 2 +- init/main.c | 1 + mm/page_alloc.c | 6 +++--- 30 files changed, 5 insertions(+), 40 deletions(-)
arch/alpha/mm/init.c +0 -1
@@ -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 ); }
arch/arc/mm/init.c +0 -1
@@ -194,7 +194,6 @@ void __init mem_init(void) {memblock_free_all ();highmem_init (); -mem_init_print_info (NULL ); }#ifdef CONFIG_HIGHMEM
arch/arm/mm/init.c +0 -2
@@ -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.
arch/arm64/mm/init.c +0 -2
@@ -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.
arch/csky/mm/init.c +0 -1
@@ -107,7 +107,6 @@ void __init mem_init(void) free_highmem_page(page); }#endif -mem_init_print_info (NULL ); }void free_initmem (void )
arch/h8300/mm/init.c +0 -2
@@ -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 ); }
arch/hexagon/mm/init.c +0 -1
@@ -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
arch/ia64/mm/init.c +0 -1
@@ -659,7 +659,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
arch/m68k/mm/init.c +0 -1
@@ -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 ); }
arch/microblaze/mm/init.c +0 -1
@@ -131,7 +131,6 @@ void __init mem_init(void)highmem_setup ();#endif -mem_init_print_info (NULL ); mem_init_done =1 ; }
arch/mips/loongson64/numa.c +0 -1
@@ -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 */
arch/mips/mm/init.c +0 -1
@@ -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 )
arch/mips/sgi-ip27/ip27-memory.c +0 -1
@@ -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 ); }
arch/nds32/mm/init.c +0 -1
@@ -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"
arch/nios2/mm/init.c +0 -1
@@ -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 )
arch/openrisc/mm/init.c +0 -2
@@ -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 ;
arch/parisc/mm/init.c +0 -2
@@ -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.
arch/powerpc/mm/mem.c +0 -1
@@ -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
arch/riscv/mm/init.c +0 -1
@@ -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 (); }
arch/s390/mm/init.c +0 -2
@@ -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 )
arch/sh/mm/init.c +0 -1
@@ -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"
arch/sparc/mm/init_32.c +0 -2
@@ -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)
arch/sparc/mm/init_64.c +0 -1
@@ -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 ();
arch/um/kernel/mem.c +0 -1
@@ -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 ; }
arch/x86/mm/init_32.c +0 -2
@@ -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.
arch/x86/mm/init_64.c +0 -2
@@ -1350,8 +1350,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
arch/xtensa/mm/init.c +0 -1
@@ -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"
include/linux/mm.h +1 -1
@@ -2373,7 +2373,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);
init/main.c +1 -0
@@ -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 ();
mm/page_alloc.c +3 -3
@@ -7728,7 +7728,7 @@ unsigned long free_reserved_area(void *start, void *end, int poison, const charreturn 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;
@@ -7767,7 +7767,7 @@ void __init mem_init_print_info(const char *str)#ifdef CONFIG_HIGHMEM ", %luK highmem" #endif -"%s%s)\n" , +"%s)\n" ,nr_free_pages () << (PAGE_SHIFT -10 ), physpages << (PAGE_SHIFT -10 ), codesize >> 10, datasize >> 10, rosize >> 10,
@@ -7777,7 +7777,7 @@ void __init mem_init_print_info(const char *str)#ifdef CONFIG_HIGHMEM totalhigh_pages () << (PAGE_SHIFT -10 ), #endif - str ? ", " : "", str ? str : ""); + ""); }/**
Signature · 1 line
2.26.2
Le 16/03/2021 à 16:29, Kefeng Wang a écrit :
Quoted 65 lines
mem_init_print_info()is called inmem_init()on each architecture, and pass NULL argument, so using void argument and move it intomm_init().Signed-off-by Kefeng Wang <[email protected]>---
Resend with 'str' line cleanup, and only test on ARM64 qemu.
arch/alpha/mm/init.c | 1 - arch/arc/mm/init.c | 1 - arch/arm/mm/init.c | 2 -- arch/arm64/mm/init.c | 2 -- arch/csky/mm/init.c | 1 - arch/h8300/mm/init.c | 2 -- arch/hexagon/mm/init.c | 1 - arch/ia64/mm/init.c | 1 - arch/m68k/mm/init.c | 1 - arch/microblaze/mm/init.c | 1 - arch/mips/loongson64/numa.c | 1 - arch/mips/mm/init.c | 1 - arch/mips/sgi-ip27/ip27-memory.c | 1 - arch/nds32/mm/init.c | 1 - arch/nios2/mm/init.c | 1 - arch/openrisc/mm/init.c | 2 -- arch/parisc/mm/init.c | 2 -- arch/powerpc/mm/mem.c | 1 - arch/riscv/mm/init.c | 1 - arch/s390/mm/init.c | 2 -- arch/sh/mm/init.c | 1 - arch/sparc/mm/init_32.c | 2 -- arch/sparc/mm/init_64.c | 1 - arch/um/kernel/mem.c | 1 - arch/x86/mm/init_32.c | 2 -- arch/x86/mm/init_64.c | 2 -- arch/xtensa/mm/init.c | 1 - include/linux/mm.h | 2 +- init/main.c | 1 + mm/page_alloc.c | 6 +++--- 30 files changed, 5 insertions(+), 40 deletions(-)mm/page_alloc.c +2
-2@@ -7728,7 +7728,7 @@ unsigned long free_reserved_area(void *start, void *end, int poison, const charreturn 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;@@ -7767,7 +7767,7 @@ void __init mem_init_print_info(const char *str)#ifdef CONFIG_HIGHMEM ", %luK highmem" #endif -"%s%s)\n" , +"%s)\n" ,nr_free_pages () << (PAGE_SHIFT -10 ), physpages << (PAGE_SHIFT -10 ), codesize >> 10, datasize >> 10, rosize >> 10,
mm/page_alloc.c void __init mem_init_print_info(const char *str) · line 7783
Quoted 8 lines
mm/page_alloc.c +1
-1@@ -7777,7 +7777,7 @@ void __init mem_init_print_info(const char *str)#ifdef CONFIG_HIGHMEM totalhigh_pages () << (PAGE_SHIFT -10 ), #endif - str ? ", " : "", str ? str : ""); + ""); }/**
What is the benefit of a %s to print a constant "" ?
You should tidy up completely.
Christophe
PATCH v2 1/1 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().
---
v2:
- Cleanup 'str' line suggested by Christophe and ACK
arch/alpha/mm/init.c | 1 - arch/arc/mm/init.c | 1 - arch/arm/mm/init.c | 2 -- arch/arm64/mm/init.c | 2 -- arch/csky/mm/init.c | 1 - arch/h8300/mm/init.c | 2 -- arch/hexagon/mm/init.c | 1 - arch/ia64/mm/init.c | 1 - arch/m68k/mm/init.c | 1 - arch/microblaze/mm/init.c | 1 - arch/mips/loongson64/numa.c | 1 - arch/mips/mm/init.c | 1 - arch/mips/sgi-ip27/ip27-memory.c | 1 - arch/nds32/mm/init.c | 1 - arch/nios2/mm/init.c | 1 - arch/openrisc/mm/init.c | 2 -- arch/parisc/mm/init.c | 2 -- arch/powerpc/mm/mem.c | 1 - arch/riscv/mm/init.c | 1 - arch/s390/mm/init.c | 2 -- arch/sh/mm/init.c | 1 - arch/sparc/mm/init_32.c | 2 -- arch/sparc/mm/init_64.c | 1 - arch/um/kernel/mem.c | 1 - arch/x86/mm/init_32.c | 2 -- arch/x86/mm/init_64.c | 2 -- arch/xtensa/mm/init.c | 1 - include/linux/mm.h | 2 +- init/main.c | 1 + mm/page_alloc.c | 10 +++++----- 30 files changed, 7 insertions(+), 42 deletions(-)
arch/alpha/mm/init.c +0 -1
@@ -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 ); }
arch/arc/mm/init.c +0 -1
@@ -194,7 +194,6 @@ void __init mem_init(void) {memblock_free_all ();highmem_init (); -mem_init_print_info (NULL ); }#ifdef CONFIG_HIGHMEM
arch/arm/mm/init.c +0 -2
@@ -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.
arch/arm64/mm/init.c +0 -2
@@ -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.
arch/csky/mm/init.c +0 -1
@@ -107,7 +107,6 @@ void __init mem_init(void) free_highmem_page(page); }#endif -mem_init_print_info (NULL ); }void free_initmem (void )
arch/h8300/mm/init.c +0 -2
@@ -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 ); }
arch/hexagon/mm/init.c +0 -1
@@ -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
arch/ia64/mm/init.c +0 -1
@@ -659,7 +659,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
arch/m68k/mm/init.c +0 -1
@@ -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 ); }
arch/microblaze/mm/init.c +0 -1
@@ -131,7 +131,6 @@ void __init mem_init(void)highmem_setup ();#endif -mem_init_print_info (NULL ); mem_init_done =1 ; }
arch/mips/loongson64/numa.c +0 -1
@@ -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 */
arch/mips/mm/init.c +0 -1
@@ -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 )
arch/mips/sgi-ip27/ip27-memory.c +0 -1
@@ -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 ); }
arch/nds32/mm/init.c +0 -1
@@ -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"
arch/nios2/mm/init.c +0 -1
@@ -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 )
arch/openrisc/mm/init.c +0 -2
@@ -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 ;
arch/parisc/mm/init.c +0 -2
@@ -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.
arch/powerpc/mm/mem.c +0 -1
@@ -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
arch/riscv/mm/init.c +0 -1
@@ -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 (); }
arch/s390/mm/init.c +0 -2
@@ -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 )
arch/sh/mm/init.c +0 -1
@@ -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"
arch/sparc/mm/init_32.c +0 -2
@@ -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)
arch/sparc/mm/init_64.c +0 -1
@@ -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 ();
arch/um/kernel/mem.c +0 -1
@@ -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 ; }
arch/x86/mm/init_32.c +0 -2
@@ -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.
arch/x86/mm/init_64.c +0 -2
@@ -1350,8 +1350,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
arch/xtensa/mm/init.c +0 -1
@@ -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"
include/linux/mm.h +1 -1
@@ -2373,7 +2373,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);
init/main.c +1 -0
@@ -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 ();
mm/page_alloc.c +5 -5
@@ -7728,7 +7728,7 @@ unsigned long free_reserved_area(void *start, void *end, int poison, const charreturn 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;
@@ -7767,17 +7767,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 : ""); + ); }/**
Signature · 1 line
2.26.2
Le 17/03/2021 à 02:52, Kefeng Wang a écrit :
Quoted 47 lines
mem_init_print_info()is called inmem_init()on each architecture, and pass NULL argument, so using void argument and move it intomm_init().Acked-by Dave Hansen <[email protected]>Signed-off-by Kefeng Wang <[email protected]>---
v2:
- Cleanup 'str' line suggested by Christophe and ACKarch/alpha/mm/init.c | 1 - arch/arc/mm/init.c | 1 - arch/arm/mm/init.c | 2 -- arch/arm64/mm/init.c | 2 -- arch/csky/mm/init.c | 1 - arch/h8300/mm/init.c | 2 -- arch/hexagon/mm/init.c | 1 - arch/ia64/mm/init.c | 1 - arch/m68k/mm/init.c | 1 - arch/microblaze/mm/init.c | 1 - arch/mips/loongson64/numa.c | 1 - arch/mips/mm/init.c | 1 - arch/mips/sgi-ip27/ip27-memory.c | 1 - arch/nds32/mm/init.c | 1 - arch/nios2/mm/init.c | 1 - arch/openrisc/mm/init.c | 2 -- arch/parisc/mm/init.c | 2 -- arch/powerpc/mm/mem.c | 1 - arch/riscv/mm/init.c | 1 - arch/s390/mm/init.c | 2 -- arch/sh/mm/init.c | 1 - arch/sparc/mm/init_32.c | 2 -- arch/sparc/mm/init_64.c | 1 - arch/um/kernel/mem.c | 1 - arch/x86/mm/init_32.c | 2 -- arch/x86/mm/init_64.c | 2 -- arch/xtensa/mm/init.c | 1 - include/linux/mm.h | 2 +- init/main.c | 1 + mm/page_alloc.c | 10 +++++----- 30 files changed, 7 insertions(+), 42 deletions(-)include/linux/mm.h +0
-0
include/linux/mm.h extern unsigned long free_reserved_area(void *start, void *end, · line 2376
Quoted 5 lines
include/linux/mm.h +1
-1@@ -2373,7 +2373,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 );
Sorry I didn't see that in previous patch.
'extern' keyword is pointless for function prototypes and is deprecated, you should remove it.
That said,
Quoted 3 lines
include/linux/mm.h +0
-0extern void reserve_bootmem_region (phys_addr_t start,phys_addr_t end);
Quoted 58 lines · Christophe Leroy
Le 17/03/2021 à 02:52, Kefeng Wang a écrit :
Quoted 47 lines
mem_init_print_info()is called inmem_init()on each architecture, and pass NULL argument, so using void argument and move it intomm_init().Acked-by Dave Hansen <[email protected]>Signed-off-by Kefeng Wang <[email protected]>---
v2:
- Cleanup 'str' line suggested by Christophe and ACKarch/alpha/mm/init.c | 1 -
arch/arc/mm/init.c | 1 -
arch/arm/mm/init.c | 2 --
arch/arm64/mm/init.c | 2 --
arch/csky/mm/init.c | 1 -
arch/h8300/mm/init.c | 2 --
arch/hexagon/mm/init.c | 1 -
arch/ia64/mm/init.c | 1 -
arch/m68k/mm/init.c | 1 -
arch/microblaze/mm/init.c | 1 -
arch/mips/loongson64/numa.c | 1 -
arch/mips/mm/init.c | 1 -
arch/mips/sgi-ip27/ip27-memory.c| 1 -
arch/nds32/mm/init.c | 1 -
arch/nios2/mm/init.c | 1 -
arch/openrisc/mm/init.c | 2 --
arch/parisc/mm/init.c | 2 --
arch/powerpc/mm/mem.c | 1 -
arch/riscv/mm/init.c | 1 -
arch/s390/mm/init.c | 2 --
arch/sh/mm/init.c | 1 -
arch/sparc/mm/init_32.c | 2 --
arch/sparc/mm/init_64.c | 1 -
arch/um/kernel/mem.c | 1 -arch/x86/mm/init_32.c | 2 -- arch/x86/mm/init_64.c | 2 -- arch/xtensa/mm/init.c | 1 - include/linux/mm.h | 2 +- init/main.c | 1 + mm/page_alloc.c | 10 +++++----- 30 files changed, 7 insertions(+), 42 deletions(-)include/linux/mm.h +0
-0include/linux/mm.h extern unsigned long free_reserved_area(void · line 2376
Quoted 5 lines
include/linux/mm.h +1
-1@@ -2373,7 +2373,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 );Sorry I didn't see that in previous patch.
Quoted 5 lines
'extern' keyword is pointless for function prototypes and is deprecated, you should remove it.
That said,
Thanks, let's wait for more feedback from other architectures, if necessary, will send a new one.
Quoted 4 lines
include/linux/mm.h extern unsigned long free_reserved_area(void *start, void *end, · line 2378
Quoted 2 lines
include/linux/mm.h +0
-0extern void reserve_bootmem_region(phys_addr_t start, phys_addr_t end);.
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Quoted 417 lines · Kefeng Wang
mem_init_print_info()is called inmem_init()on each architecture, and pass NULL argument, so using void argument and move it intomm_init().Acked-by Dave Hansen <[email protected]>Signed-off-by Kefeng Wang <[email protected]>---
v2:
- Cleanup 'str' line suggested by Christophe and ACKarch/alpha/mm/init.c | 1 - arch/arc/mm/init.c | 1 - arch/arm/mm/init.c | 2 -- arch/arm64/mm/init.c | 2 -- arch/csky/mm/init.c | 1 - arch/h8300/mm/init.c | 2 -- arch/hexagon/mm/init.c | 1 - arch/ia64/mm/init.c | 1 - arch/m68k/mm/init.c | 1 - arch/microblaze/mm/init.c | 1 - arch/mips/loongson64/numa.c | 1 - arch/mips/mm/init.c | 1 - arch/mips/sgi-ip27/ip27-memory.c | 1 - arch/nds32/mm/init.c | 1 - arch/nios2/mm/init.c | 1 - arch/openrisc/mm/init.c | 2 -- arch/parisc/mm/init.c | 2 -- arch/powerpc/mm/mem.c | 1 - arch/riscv/mm/init.c | 1 - arch/s390/mm/init.c | 2 -- arch/sh/mm/init.c | 1 - arch/sparc/mm/init_32.c | 2 -- arch/sparc/mm/init_64.c | 1 - arch/um/kernel/mem.c | 1 - arch/x86/mm/init_32.c | 2 -- arch/x86/mm/init_64.c | 2 -- arch/xtensa/mm/init.c | 1 - include/linux/mm.h | 2 +- init/main.c | 1 + mm/page_alloc.c | 10 +++++----- 30 files changed, 7 insertions(+), 42 deletions(-)arch/alpha/mm/init.c +0
-1@@ -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 ); }arch/arc/mm/init.c +0
-1@@ -194,7 +194,6 @@ void __init mem_init(void) {memblock_free_all ();highmem_init (); -mem_init_print_info (NULL ); }#ifdef CONFIG_HIGHMEM arch/arm/mm/init.c +0
-2@@ -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. arch/arm64/mm/init.c +0
-2@@ -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. arch/csky/mm/init.c +0
-1@@ -107,7 +107,6 @@ void __init mem_init(void) free_highmem_page(page); }#endif -mem_init_print_info (NULL ); }void free_initmem (void )arch/h8300/mm/init.c +0
-2@@ -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 ); }arch/hexagon/mm/init.c +0
-1@@ -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 arch/ia64/mm/init.c +0
-1@@ -659,7 +659,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 arch/m68k/mm/init.c +0
-1@@ -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 ); }arch/microblaze/mm/init.c +0
-1@@ -131,7 +131,6 @@ void __init mem_init(void)highmem_setup ();#endif -mem_init_print_info (NULL ); mem_init_done =1 ; }arch/mips/loongson64/numa.c +0
-1@@ -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 */ arch/mips/mm/init.c +0
-1@@ -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 )arch/mips/sgi-ip27/ip27-memory.c +0
-1@@ -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 ); }arch/nds32/mm/init.c +0
-1@@ -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"arch/nios2/mm/init.c +0
-1@@ -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 )arch/openrisc/mm/init.c +0
-2@@ -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 ;arch/parisc/mm/init.c +0
-2@@ -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. arch/powerpc/mm/mem.c +0
-1@@ -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 arch/riscv/mm/init.c +0
-1@@ -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 (); }arch/s390/mm/init.c +0
-2@@ -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 )arch/sh/mm/init.c +0
-1@@ -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"arch/sparc/mm/init_32.c +0
-2@@ -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)arch/sparc/mm/init_64.c +0
-1@@ -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 ();arch/um/kernel/mem.c +0
-1@@ -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 ; }arch/x86/mm/init_32.c +0
-2@@ -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. arch/x86/mm/init_64.c +0
-2@@ -1350,8 +1350,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 arch/xtensa/mm/init.c +0
-1@@ -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"include/linux/mm.h +1
-1@@ -2373,7 +2373,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);init/main.c +1
-0@@ -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 ();mm/page_alloc.c +2
-3@@ -7728,7 +7728,7 @@ unsigned long free_reserved_area(void *start, void *end, int poison, const charreturn 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;@@ -7767,17 +7767,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),
mm/page_alloc.c void __init mem_init_print_info(const char *str) · line 7783
Quoted 10 lines
mm/page_alloc.c +3
-2+ totalcma_pages << (PAGE_SHIFT - 10) #ifdef CONFIG_HIGHMEM -totalhigh_pages () << (PAGE_SHIFT -10 ), + ,totalhigh_pages () << (PAGE_SHIFT -10 ) #endif - str ? ", " : "", str ? str : ""); + ); }/**
As I had roughly the same patch laying around here when playing with adjustments of the managed page counters
Signature · 3 lines
Thanks, David / dhildenb
Quoted 9 lines · Kefeng Wang
mem_init_print_info()is called inmem_init()on each architecture, and pass NULL argument, so using void argument and move it intomm_init().Acked-by Dave Hansen <[email protected]>Signed-off-by Kefeng Wang <[email protected]>---
v2:
- Cleanup 'str' line suggested by Christophe and ACK
applied patch (5.12.0-rc3-00020-g1df27313f50a-dirty) over linus.git and tested boot on a sparc64 virtual machine (ldom) - boots.
Quoted 4 lines · Kefeng Wang
mem_init_print_info()is called inmem_init()on each architecture, and pass NULL argument, so using void argument and move it intomm_init().Acked-by Dave Hansen <[email protected]>
It's not a big deal but you might want to say something like:
Just to make it clear that I didn't look at the alpha bits at all. :)
Quoted 10 lines · Dave Hansen
Quoted 4 lines · Kefeng Wang
mem_init_print_info()is called inmem_init()on each architecture, and pass NULL argument, so using void argument and move it intomm_init().Acked-by Dave Hansen <[email protected]>It's not a big deal but you might want to say something like:
Just to make it clear that I didn't look at the alpha bits at all. :)
Get it, will be careful, thanks.
Quoted 2 lines
.
Quoted 5 lines · Kefeng Wang
mem_init_print_info()is called inmem_init()on each architecture, and pass NULL argument, so using void argument and move it intomm_init().Acked-by Dave Hansen <[email protected]>Signed-off-by Kefeng Wang <[email protected]>
Thx,
-Vineet
Hi Andrew, kindly ping
Quoted 426 lines · Kefeng Wang
mem_init_print_info()is called inmem_init()on each architecture, and pass NULL argument, so using void argument and move it intomm_init().Acked-by Dave Hansen <[email protected]>Signed-off-by Kefeng Wang <[email protected]>---
v2:
- Cleanup 'str' line suggested by Christophe and ACKarch/alpha/mm/init.c | 1 - arch/arc/mm/init.c | 1 - arch/arm/mm/init.c | 2 -- arch/arm64/mm/init.c | 2 -- arch/csky/mm/init.c | 1 - arch/h8300/mm/init.c | 2 -- arch/hexagon/mm/init.c | 1 - arch/ia64/mm/init.c | 1 - arch/m68k/mm/init.c | 1 - arch/microblaze/mm/init.c | 1 - arch/mips/loongson64/numa.c | 1 - arch/mips/mm/init.c | 1 - arch/mips/sgi-ip27/ip27-memory.c | 1 - arch/nds32/mm/init.c | 1 - arch/nios2/mm/init.c | 1 - arch/openrisc/mm/init.c | 2 -- arch/parisc/mm/init.c | 2 -- arch/powerpc/mm/mem.c | 1 - arch/riscv/mm/init.c | 1 - arch/s390/mm/init.c | 2 -- arch/sh/mm/init.c | 1 - arch/sparc/mm/init_32.c | 2 -- arch/sparc/mm/init_64.c | 1 - arch/um/kernel/mem.c | 1 - arch/x86/mm/init_32.c | 2 -- arch/x86/mm/init_64.c | 2 -- arch/xtensa/mm/init.c | 1 - include/linux/mm.h | 2 +- init/main.c | 1 + mm/page_alloc.c | 10 +++++----- 30 files changed, 7 insertions(+), 42 deletions(-)arch/alpha/mm/init.c +0
-1@@ -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 ); }arch/arc/mm/init.c +0
-1@@ -194,7 +194,6 @@ void __init mem_init(void) {memblock_free_all ();highmem_init (); -mem_init_print_info (NULL ); }#ifdef CONFIG_HIGHMEM arch/arm/mm/init.c +0
-2@@ -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. arch/arm64/mm/init.c +0
-2@@ -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. arch/csky/mm/init.c +0
-1@@ -107,7 +107,6 @@ void __init mem_init(void) free_highmem_page(page); }#endif -mem_init_print_info (NULL ); }void free_initmem (void )arch/h8300/mm/init.c +0
-2@@ -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 ); }arch/hexagon/mm/init.c +0
-1@@ -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 arch/ia64/mm/init.c +0
-1@@ -659,7 +659,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 arch/m68k/mm/init.c +0
-1@@ -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 ); }arch/microblaze/mm/init.c +0
-1@@ -131,7 +131,6 @@ void __init mem_init(void)highmem_setup ();#endif -mem_init_print_info (NULL ); mem_init_done =1 ; }arch/mips/loongson64/numa.c +0
-1@@ -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 */ arch/mips/mm/init.c +0
-1@@ -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 )arch/mips/sgi-ip27/ip27-memory.c +0
-1@@ -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 ); }arch/nds32/mm/init.c +0
-1@@ -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"arch/nios2/mm/init.c +0
-1@@ -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 )arch/openrisc/mm/init.c +0
-2@@ -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 ;arch/parisc/mm/init.c +0
-2@@ -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. arch/powerpc/mm/mem.c +0
-1@@ -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 arch/riscv/mm/init.c +0
-1@@ -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 (); }arch/s390/mm/init.c +0
-2@@ -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 )arch/sh/mm/init.c +0
-1@@ -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"arch/sparc/mm/init_32.c +0
-2@@ -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)arch/sparc/mm/init_64.c +0
-1@@ -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 ();arch/um/kernel/mem.c +0
-1@@ -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 ; }arch/x86/mm/init_32.c +0
-2@@ -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. arch/x86/mm/init_64.c +0
-2@@ -1350,8 +1350,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 arch/xtensa/mm/init.c +0
-1@@ -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"include/linux/mm.h +1
-1@@ -2373,7 +2373,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);init/main.c +1
-0@@ -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 ();mm/page_alloc.c +5
-5@@ -7728,7 +7728,7 @@ unsigned long free_reserved_area(void *start, void *end, int poison, const charreturn 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;@@ -7767,17 +7767,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 : ""); + ); }/**
Quoted 5 lines · Kefeng Wang
mem_init_print_info()is called inmem_init()on each architecture, and pass NULL argument, so using void argument and move it intomm_init().Acked-by Dave Hansen <[email protected]>Signed-off-by Kefeng Wang <[email protected]>
Quoted 4 lines
---
v2:
- Cleanup 'str' line suggested by Christophe and ACK
Quoted 5 lines · Kefeng Wang
mem_init_print_info()is called inmem_init()on each architecture, and pass NULL argument, so using void argument and move it intomm_init().Acked-by Dave Hansen <[email protected]>Signed-off-by Kefeng Wang <[email protected]>
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
kernel test robot
build botThank you for the patch! Yet something to improve:
Hi Kefeng,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on tip/x86/mm]
[also build test ERROR on linus/master v5.12-rc3 next-20210316] [cannot apply to hnaz-linux-mm/master sparc/master sparc-next/master] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Kefeng-Wang/mm-Move-mem_init_print_info-into-mm_init/20210316-222501 base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git a500fc918f7b8dc3dff2e6c74f3e73e856c18248 config: riscv-randconfig-r031-20210316 (attached as .config) compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 50c7504a93fdb90c26870db8c8ea7add895c7725)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/0day-ci/linux/commit/0b2c07917fb7f9f87f0e2ecac3a3985155778856
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Kefeng-Wang/mm-Move-mem_init_print_info-into-mm_init/20210316-222501 git checkout 0b2c07917fb7f9f87f0e2ecac3a3985155778856
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
mm/page_alloc.c:3600:15: warning: no previous prototype for function 'should_fail_alloc_page' [-Wmissing-prototypes] noinline bool should_fail_alloc_page(gfp_t gfp_mask, unsigned int order)
^
mm/page_alloc.c:3600:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline bool should_fail_alloc_page(gfp_t gfp_mask, unsigned int order)
^
static
>> mm/page_alloc.c:7744:3: error: use of undeclared identifier 'str'
str ? ", " : "", str ? str : "");
^
mm/page_alloc.c:7744:20: error: use of undeclared identifier 'str'
str ? ", " : "", str ? str : "");
^
mm/page_alloc.c:7744:26: error: use of undeclared identifier 'str'
str ? ", " : "", str ? str : "");
^1 warning and 3 errors generated.
vim +/str +7744 mm/page_alloc.c
7ee3d4e8cd5605 Jiang Liu 2013-07-03 7729
756a025f000919 Joe Perches 2016-03-17 7730 pr_info("Memory: %luK/%luK available (%luK kernel code, %luK rwdata, %luK rodata, %luK init, %luK bss, %luK reserved, %luK cma-reserved"
7ee3d4e8cd5605 Jiang Liu 2013-07-03 7731 #ifdef CONFIG_HIGHMEM
7ee3d4e8cd5605 Jiang Liu 2013-07-03 7732 ", %luK highmem"
7ee3d4e8cd5605 Jiang Liu 2013-07-03 7733 #endif
7ee3d4e8cd5605 Jiang Liu 2013-07-03 7734 "%s%s)\n",
756a025f000919 Joe Perches 2016-03-17 7735 nr_free_pages() << (PAGE_SHIFT - 10),
756a025f000919 Joe Perches 2016-03-17 7736 physpages << (PAGE_SHIFT - 10),
7ee3d4e8cd5605 Jiang Liu 2013-07-03 7737 codesize >> 10, datasize >> 10, rosize >> 10,
7ee3d4e8cd5605 Jiang Liu 2013-07-03 7738 (init_data_size + init_code_size) >> 10, bss_size >> 10,
ca79b0c211af63 Arun KS 2018-12-28 7739 (physpages - totalram_pages() - totalcma_pages) << (PAGE_SHIFT - 10),
e48322abb061d7 Pintu Kumar 2014-12-18 7740 totalcma_pages << (PAGE_SHIFT - 10),
7ee3d4e8cd5605 Jiang Liu 2013-07-03 7741 #ifdef CONFIG_HIGHMEM
ca79b0c211af63 Arun KS 2018-12-28 7742 totalhigh_pages() << (PAGE_SHIFT - 10),
7ee3d4e8cd5605 Jiang Liu 2013-07-03 7743 #endif
7ee3d4e8cd5605 Jiang Liu 2013-07-03 @7744 str ? ", " : "", str ? str : "");
7ee3d4e8cd5605 Jiang Liu 2013-07-03 7745 }
7ee3d4e8cd5605 Jiang Liu 2013-07-03 7746 ---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
please use v2, sorry for the wrong version.
Quoted 75 lines · kernel test robot
Hi Kefeng,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on tip/x86/mm]
[also build test ERROR on linus/master v5.12-rc3 next-20210316] [cannot apply to hnaz-linux-mm/master sparc/master sparc-next/master] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]url: https://github.com/0day-ci/linux/commits/Kefeng-Wang/mm-Move-mem_init_print_info-into-mm_init/20210316-222501 base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git a500fc918f7b8dc3dff2e6c74f3e73e856c18248 config: riscv-randconfig-r031-20210316 (attached as .config) compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 50c7504a93fdb90c26870db8c8ea7add895c7725)reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/0day-ci/linux/commit/0b2c07917fb7f9f87f0e2ecac3a3985155778856
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Kefeng-Wang/mm-Move-mem_init_print_info-into-mm_init/20210316-222501 git checkout0b2c07917fb7f9f87f0e2ecac3a3985155778856
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscvIf you fix the issue, kindly add following tag as appropriate
Reported-by kernel test robot <[email protected]>All errors (new ones prefixed by >>):
mm/page_alloc.c:3600:15: warning: no previous prototype for function 'should_fail_alloc_page' [-Wmissing-prototypes] noinline boolshould_fail_alloc_page(gfp_t gfp_mask, unsigned int order)
^
mm/page_alloc.c:3600:10: note: declare 'static' if the function is not intended to be used outside of this translation unit noinline boolshould_fail_alloc_page(gfp_t gfp_mask, unsigned int order)
^
staticQuoted 1 line
Quoted 1 line
mm/page_alloc.c:7744:3: error: use of undeclared identifier 'str'str ? ", " : "", str ? str : ""); ^ mm/page_alloc.c:7744:20: error: use of undeclared identifier 'str' str ? ", " : "", str ? str : ""); ^ mm/page_alloc.c:7744:26: error: use of undeclared identifier 'str' str ? ", " : "", str ? str : ""); ^ 1 warning and 3 errors generated.vim +/str +7744
mm/page_alloc.c7ee3d4e8cd5605 Jiang Liu 2013-07-03 7729 756a025f000919 Joe Perches 2016-03-17 7730 pr_info("Memory: %luK/%luK available (%luK kernel code, %luK rwdata, %luK rodata, %luK init, %luK bss, %luK reserved, %luK cma-reserved" 7ee3d4e8cd5605 Jiang Liu 2013-07-03 7731 #ifdef CONFIG_HIGHMEM 7ee3d4e8cd5605 Jiang Liu 2013-07-03 7732 ", %luK highmem" 7ee3d4e8cd5605 Jiang Liu 2013-07-03 7733 #endif 7ee3d4e8cd5605 Jiang Liu 2013-07-03 7734 "%s%s)\n", 756a025f000919 Joe Perches 2016-03-17 7735 nr_free_pages() << (PAGE_SHIFT - 10), 756a025f000919 Joe Perches 2016-03-17 7736 physpages << (PAGE_SHIFT - 10), 7ee3d4e8cd5605 Jiang Liu 2013-07-03 7737 codesize >> 10, datasize >> 10, rosize >> 10, 7ee3d4e8cd5605 Jiang Liu 2013-07-03 7738 (init_data_size + init_code_size) >> 10, bss_size >> 10, ca79b0c211af63 Arun KS 2018-12-28 7739 (physpages - totalram_pages() - totalcma_pages) << (PAGE_SHIFT - 10), e48322abb061d7 Pintu Kumar 2014-12-18 7740 totalcma_pages << (PAGE_SHIFT - 10), 7ee3d4e8cd5605 Jiang Liu 2013-07-03 7741 #ifdef CONFIG_HIGHMEM ca79b0c211af63 Arun KS 2018-12-28 7742 totalhigh_pages() << (PAGE_SHIFT - 10), 7ee3d4e8cd5605 Jiang Liu 2013-07-03 7743 #endif 7ee3d4e8cd5605 Jiang Liu 2013-07-03 @7744 str ? ", " : "", str ? str : ""); 7ee3d4e8cd5605 Jiang Liu 2013-07-03 7745 } 7ee3d4e8cd5605 Jiang Liu 2013-07-03 7746---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
arch/x86/mm/init_64.c void __init mem_init(void) · line 1353
Quoted 11 lines · Kefeng Wang
arch/x86/mm/init_64.c +0
-2@@ -1350,8 +1350,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 ); }
Ignoring any issues with the printk...
Looks harmless enough on x86. The 32-bit code has some cruft in mem_init() after mem_init_print_info(), so this patch will change the location of the mem_init_print_info(), but I think it's actually for the better, since it will be pushed later in boot. As long as the x86 pieces stay the same: