From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34A25C433DB for ; Tue, 16 Mar 2021 14:47:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9E3AF65084 for ; Tue, 16 Mar 2021 14:47:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9E3AF65084 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1655A6B0070; Tue, 16 Mar 2021 10:47:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1158C6B0071; Tue, 16 Mar 2021 10:47:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ED17E6B0072; Tue, 16 Mar 2021 10:47:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0020.hostedemail.com [216.40.44.20]) by kanga.kvack.org (Postfix) with ESMTP id CE3046B0070 for ; Tue, 16 Mar 2021 10:47:25 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 721C16129 for ; Tue, 16 Mar 2021 14:47:25 +0000 (UTC) X-FDA: 77926015650.16.2E1E96D Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) by imf27.hostedemail.com (Postfix) with ESMTP id 4CE2F801916E for ; Tue, 16 Mar 2021 14:47:17 +0000 (UTC) Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4F0GMx4VXtz9v0Wx; Tue, 16 Mar 2021 15:47:09 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id vzRrRUF_FtQC; Tue, 16 Mar 2021 15:47:09 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4F0GMx3F8vz9v0Ww; Tue, 16 Mar 2021 15:47:09 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 56A228B7E3; Tue, 16 Mar 2021 15:47:11 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id TZSbbu2JPpo4; Tue, 16 Mar 2021 15:47:11 +0100 (CET) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 8C1248B7E1; Tue, 16 Mar 2021 15:47:09 +0100 (CET) Subject: Re: [PATCH] mm: Move mem_init_print_info() into mm_init() To: Kefeng Wang , linux-kernel@vger.kernel.org, Andrew Morton Cc: linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, Peter Zijlstra , Catalin Marinas , Dave Hansen , linux-mm@kvack.org, Guo Ren , sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org, Jonas Bonn , linux-s390@vger.kernel.org, Yoshinori Sato , linux-hexagon@vger.kernel.org, Huacai Chen , Russell King , linux-csky@vger.kernel.org, Ingo Molnar , linux-snps-arc@lists.infradead.org, linux-xtensa@linux-xtensa.org, Heiko Carstens , linux-um@lists.infradead.org, linux-m68k@lists.linux-m68k.org, openrisc@lists.librecores.org, linux-arm-kernel@lists.infradead.org, Richard Henderson , linux-parisc@vger.kernel.org, linux-mips@vger.kernel.org, Palmer Dabbelt , linux-alpha@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, "David S. Miller" References: <20210316142637.92193-1-wangkefeng.wang@huawei.com> From: Christophe Leroy Message-ID: <26cca1c0-bd38-3d5b-5ca4-44081c444396@csgroup.eu> Date: Tue, 16 Mar 2021 15:47:05 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <20210316142637.92193-1-wangkefeng.wang@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr X-Stat-Signature: auqn7d9e4jdzoegyqipzs5wisimqgrrq X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 4CE2F801916E Received-SPF: none (csgroup.eu>: No applicable sender policy available) receiver=imf27; identity=mailfrom; envelope-from=""; helo=pegase1.c-s.fr; client-ip=93.17.236.30 X-HE-DKIM-Result: none/none X-HE-Tag: 1615906037-571466 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Le 16/03/2021 =C3=A0 15:26, Kefeng Wang a =C3=A9crit=C2=A0: > 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(). >=20 > Signed-off-by: Kefeng Wang > --- > 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(-) >=20 > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 55d938297ce6..e4a6bf69c806 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -7728,7 +7728,7 @@ unsigned long free_reserved_area(void *start, voi= d *end, int poison, const char > return pages; > } > =20 > -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; >=20 And what about the 'str' in the last line of the function ? pr_info("Memory: %luK/%luK available (%luK kernel code, %luK rwdata, %lu= K rodata, %luK init, %luK=20 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