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 98380C433DB for ; Tue, 16 Mar 2021 15:20:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3FC91650DB for ; Tue, 16 Mar 2021 15:20:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3FC91650DB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D273F6B007E; Tue, 16 Mar 2021 11:20:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CD6C78D0005; Tue, 16 Mar 2021 11:20:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B78488D0003; Tue, 16 Mar 2021 11:20:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0220.hostedemail.com [216.40.44.220]) by kanga.kvack.org (Postfix) with ESMTP id 9B0376B007E for ; Tue, 16 Mar 2021 11:20:29 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 60D4B180AD830 for ; Tue, 16 Mar 2021 15:20:29 +0000 (UTC) X-FDA: 77926098978.10.3F3A375 Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) by imf21.hostedemail.com (Postfix) with ESMTP id C7292E007A64 for ; Tue, 16 Mar 2021 15:20:26 +0000 (UTC) Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4F0GjJ5s2vz8ydQ; Tue, 16 Mar 2021 23:02:12 +0800 (CST) Received: from [10.174.177.244] (10.174.177.244) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.498.0; Tue, 16 Mar 2021 23:04:03 +0800 Subject: Re: [PATCH] mm: Move mem_init_print_info() into mm_init() To: Christophe Leroy , , Andrew Morton CC: , , Peter Zijlstra , Catalin Marinas , "Dave Hansen" , , Guo Ren , , , Jonas Bonn , , Yoshinori Sato , , Huacai Chen , "Russell King" , , Ingo Molnar , , , Heiko Carstens , , , , , Richard Henderson , , , Palmer Dabbelt , , , "David S. Miller" References: <20210316142637.92193-1-wangkefeng.wang@huawei.com> <26cca1c0-bd38-3d5b-5ca4-44081c444396@csgroup.eu> From: Kefeng Wang Message-ID: Date: Tue, 16 Mar 2021 23:04:01 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <26cca1c0-bd38-3d5b-5ca4-44081c444396@csgroup.eu> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US X-Originating-IP: [10.174.177.244] X-CFilter-Loop: Reflected X-Stat-Signature: zd3qoci5poeci739wuk8kabwqfsksogk X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: C7292E007A64 Received-SPF: none (huawei.com>: No applicable sender policy available) receiver=imf21; identity=mailfrom; envelope-from=""; helo=szxga07-in.huawei.com; client-ip=45.249.212.35 X-HE-DKIM-Result: none/none X-HE-Tag: 1615908026-616385 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: On 2021/3/16 22:47, Christophe Leroy wrote: > > > 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(). >> >> Signed-off-by: Kefeng Wang >> --- >> =C2=A0 arch/alpha/mm/init.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 | 1 - >> =C2=A0 arch/arc/mm/init.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 1 - >> =C2=A0 arch/arm/mm/init.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 2 -- >> =C2=A0 arch/arm64/mm/init.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 | 2 -- >> =C2=A0 arch/csky/mm/init.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 1 - >> =C2=A0 arch/h8300/mm/init.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 | 2 -- >> =C2=A0 arch/hexagon/mm/init.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 | 1 - >> =C2=A0 arch/ia64/mm/init.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 1 - >> =C2=A0 arch/m68k/mm/init.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 1 - >> =C2=A0 arch/microblaze/mm/init.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 | 1 - >> =C2=A0 arch/mips/loongson64/numa.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 1 - >> =C2=A0 arch/mips/mm/init.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 1 - >> =C2=A0 arch/mips/sgi-ip27/ip27-memory.c | 1 - >> =C2=A0 arch/nds32/mm/init.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 | 1 - >> =C2=A0 arch/nios2/mm/init.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 | 1 - >> =C2=A0 arch/openrisc/mm/init.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 | 2 -- >> =C2=A0 arch/parisc/mm/init.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 | 2 -- >> =C2=A0 arch/powerpc/mm/mem.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 | 1 - >> =C2=A0 arch/riscv/mm/init.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=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0=C2=A0=C2=A0=C2=A0=C2=A0 = | 1 + >> =C2=A0 mm/page_alloc.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 2 +- >> =C2=A0 30 files changed, 3 insertions(+), 38 deletions(-) >> > >> 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,=20 >> void *end, int poison, const char >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return pages; >> =C2=A0 } >> =C2=A0 -void __init mem_init_print_info(const char *str) >> +void __init mem_init_print_info(void) >> =C2=A0 { >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned long physpages, codesize, data= size, rosize, bss_size; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned long init_code_size, init_data= _size; >> > > And what about the 'str' in the last line of the function ? > > =C2=A0=C2=A0=C2=A0=C2=A0pr_info("Memory: %luK/%luK available (%luK kern= el code, %luK=20 > rwdata, %luK rodata, %luK init, %luK bss, %luK reserved, %luK=20 > cma-reserved" > #ifdef=C2=A0=C2=A0=C2=A0 CONFIG_HIGHMEM > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ", %luK highmem" > #endif > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "%s%s)\n", > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 nr_free_pages() << (PAGE_SHI= FT - 10), > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 physpages << (PAGE_SHIFT - 1= 0), > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 codesize >> 10, datasize >> = 10, rosize >> 10, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (init_data_size + init_code_= size) >> 10, bss_size >> 10, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (physpages - totalram_pages(= ) - totalcma_pages) << (PAGE_SHIFT=20 > - 10), > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 totalcma_pages << (PAGE_SHIF= T - 10), > #ifdef=C2=A0=C2=A0=C2=A0 CONFIG_HIGHMEM > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 totalhigh_pages() << (PAGE_S= HIFT - 10), > #endif > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 str ? ", " : "", str ? str := ""); oh,=C2=A0=C2=A0 I send a bad version=EF=BC=8Cfirstly I want to split two = patches, one for=20 function move, one for function change. sorry, please ignore it=EF=BC=8C thanks for your remind. > > > Christophe > . >