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,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 7A091C43460 for ; Wed, 28 Apr 2021 10:20:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CABEF6142C for ; Wed, 28 Apr 2021 10:20:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CABEF6142C 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 1E9CD6B0036; Wed, 28 Apr 2021 06:20:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 19A8D6B006E; Wed, 28 Apr 2021 06:20:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 039ED6B0070; Wed, 28 Apr 2021 06:20:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0059.hostedemail.com [216.40.44.59]) by kanga.kvack.org (Postfix) with ESMTP id D76A86B0036 for ; Wed, 28 Apr 2021 06:20:50 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 918A545A8 for ; Wed, 28 Apr 2021 10:20:50 +0000 (UTC) X-FDA: 78081382260.01.AD7BB52 Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) by imf09.hostedemail.com (Postfix) with ESMTP id E7C356000112 for ; Wed, 28 Apr 2021 10:20:42 +0000 (UTC) Received: from localhost (mailhub3.si.c-s.fr [192.168.12.233]) by localhost (Postfix) with ESMTP id 4FVZQk5S63z9tWv; Wed, 28 Apr 2021 12:20:46 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4KF_MRN7mc2b; Wed, 28 Apr 2021 12:20:46 +0200 (CEST) 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 4FVX4B50rWz9wBD; Wed, 28 Apr 2021 10:34:34 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 802658B800; Wed, 28 Apr 2021 10:34:34 +0200 (CEST) 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 Gx7tFBR7ujua; Wed, 28 Apr 2021 10:34:34 +0200 (CEST) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 56CED8B799; Wed, 28 Apr 2021 10:34:33 +0200 (CEST) Subject: Re: [PATCH v13 06/14] mm: HUGE_VMAP arch support cleanup From: Christophe Leroy To: Nicholas Piggin , linux-mm@kvack.org, Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Jonathan Cameron , Christoph Hellwig , Rick Edgecombe , Ding Tianhong , linuxppc-dev@lists.ozlabs.org, Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" References: <20210317062402.533919-1-npiggin@gmail.com> <20210317062402.533919-7-npiggin@gmail.com> <303a93df-6b32-1b3e-d293-b569e1a4b03e@csgroup.eu> Message-ID: Date: Wed, 28 Apr 2021 10:34:28 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <303a93df-6b32-1b3e-d293-b569e1a4b03e@csgroup.eu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: E7C356000112 X-Stat-Signature: 133hhk5itpo6xy98iyzrhnog8xanij1g Received-SPF: none (csgroup.eu>: No applicable sender policy available) receiver=imf09; identity=mailfrom; envelope-from=""; helo=pegase1.c-s.fr; client-ip=93.17.236.30 X-HE-DKIM-Result: none/none X-HE-Tag: 1619605242-330588 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 28/04/2021 =C3=A0 10:32, Christophe Leroy a =C3=A9crit=C2=A0: >=20 >=20 > Le 17/03/2021 =C3=A0 07:23, Nicholas Piggin a =C3=A9crit=C2=A0: >> This changes the awkward approach where architectures provide init >> functions to determine which levels they can provide large mappings fo= r, >> to one where the arch is queried for each call. >> >> This removes code and indirection, and allows constant-folding of dead >> code for unsupported levels. >> >> This also adds a prot argument to the arch query. This is unused >> currently but could help with some architectures (e.g., some powerpc >> processors can't map uncacheable memory with large pages). >> >> Cc: linuxppc-dev@lists.ozlabs.org >> Cc: Catalin Marinas >> Cc: Will Deacon >> Cc: linux-arm-kernel@lists.infradead.org >> Cc: Thomas Gleixner >> Cc: Ingo Molnar >> Cc: Borislav Petkov >> Cc: x86@kernel.org >> Cc: "H. Peter Anvin" >> Reviewed-by: Ding Tianhong >> Acked-by: Catalin Marinas [arm64] >> Signed-off-by: Nicholas Piggin >> --- >> =C2=A0 arch/arm64/include/asm/vmalloc.h=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 |=C2=A0 8 ++ >> =C2=A0 arch/arm64/mm/mmu.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=C2=A0=C2=A0=C2=A0= =C2=A0 | 10 +-- >> =C2=A0 arch/powerpc/include/asm/vmalloc.h=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 |=C2=A0 8 ++ >> =C2=A0 arch/powerpc/mm/book3s64/radix_pgtable.c |=C2=A0 8 +- >> =C2=A0 arch/x86/include/asm/vmalloc.h=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 7 ++ >> =C2=A0 arch/x86/mm/ioremap.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=C2=A0=C2=A0 = | 12 +-- >> =C2=A0 include/linux/io.h=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=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 |=C2=A0 9 --- >> =C2=A0 include/linux/vmalloc.h=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 |=C2=A0 6 ++ >> =C2=A0 init/main.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=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 mm/debug_vm_pgtable.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=C2=A0=C2=A0 = |=C2=A0 4 +- >> =C2=A0 mm/ioremap.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=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 94 ++++++++++-------------- >> =C2=A0 11 files changed, 87 insertions(+), 80 deletions(-) >> >=20 >> diff --git a/mm/ioremap.c b/mm/ioremap.c >> index 3f4d36f9745a..3264d0203785 100644 >> --- a/mm/ioremap.c >> +++ b/mm/ioremap.c >> @@ -16,49 +16,16 @@ >> =C2=A0 #include "pgalloc-track.h" >> =C2=A0 #ifdef CONFIG_HAVE_ARCH_HUGE_VMAP >> -static int __read_mostly ioremap_p4d_capable; >> -static int __read_mostly ioremap_pud_capable; >> -static int __read_mostly ioremap_pmd_capable; >> -static int __read_mostly ioremap_huge_disabled; >> +static bool __ro_after_init iomap_max_page_shift =3D PAGE_SHIFT; >=20 > Must be an int, not a bool. And the initial value seems wrong. Should be P4D_SHIFT ? >=20 >> =C2=A0 static int __init set_nohugeiomap(char *str) >> =C2=A0 { >> -=C2=A0=C2=A0=C2=A0 ioremap_huge_disabled =3D 1; >> +=C2=A0=C2=A0=C2=A0 iomap_max_page_shift =3D P4D_SHIFT; And PAGE_SHIFT here when NO hugeiomap ? >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return 0; >> =C2=A0 } >> =C2=A0 early_param("nohugeiomap", set_nohugeiomap); Christophe