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=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SIGNED_OFF_BY,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 882D6C43461 for ; Wed, 2 Sep 2020 12:40:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 47AF420758 for ; Wed, 2 Sep 2020 12:40:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 47AF420758 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 A666B6B0075; Wed, 2 Sep 2020 08:40:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9F02D6B0078; Wed, 2 Sep 2020 08:40:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8B7CA6B007D; Wed, 2 Sep 2020 08:40:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0009.hostedemail.com [216.40.44.9]) by kanga.kvack.org (Postfix) with ESMTP id 714D86B0075 for ; Wed, 2 Sep 2020 08:40:42 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 3A5B6181AEF09 for ; Wed, 2 Sep 2020 12:40:42 +0000 (UTC) X-FDA: 77218080324.12.ray48_0904908270a1 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id D748C18005B00 for ; Wed, 2 Sep 2020 12:40:41 +0000 (UTC) X-HE-Tag: ray48_0904908270a1 X-Filterd-Recvd-Size: 5136 Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Wed, 2 Sep 2020 12:40:41 +0000 (UTC) Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4BhNny1KHpz9txSj; Wed, 2 Sep 2020 14:40:38 +0200 (CEST) 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 iYRqEll7XluB; Wed, 2 Sep 2020 14:40:38 +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 4BhNny0VQGz9txSg; Wed, 2 Sep 2020 14:40:38 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 8D3428B7E6; Wed, 2 Sep 2020 14:40:39 +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 S0aC3aZkjhef; Wed, 2 Sep 2020 14:40:39 +0200 (CEST) Received: from [10.25.210.31] (unknown [10.25.210.31]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 68D048B7E5; Wed, 2 Sep 2020 14:40:39 +0200 (CEST) Subject: Re: [PATCH v4 04/13] mm/debug_vm_pgtables/hugevmap: Use the arch helper to identify huge vmap support. To: "Aneesh Kumar K.V" , linux-mm@kvack.org, akpm@linux-foundation.org Cc: linuxppc-dev@lists.ozlabs.org, Anshuman Khandual References: <20200902114222.181353-1-aneesh.kumar@linux.ibm.com> <20200902114222.181353-5-aneesh.kumar@linux.ibm.com> From: Christophe Leroy Message-ID: <7e88e090-e3af-b26c-ca65-3d98e8f81eb3@csgroup.eu> Date: Wed, 2 Sep 2020 14:40:31 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200902114222.181353-5-aneesh.kumar@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr X-Rspamd-Queue-Id: D748C18005B00 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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 02/09/2020 =C3=A0 13:42, Aneesh Kumar K.V a =C3=A9crit=C2=A0: > ppc64 supports huge vmap only with radix translation. Hence use arch he= lper > to determine the huge vmap support. >=20 > Signed-off-by: Aneesh Kumar K.V > --- > mm/debug_vm_pgtable.c | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) >=20 > diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c > index 00649b47f6e0..4c73e63b4ceb 100644 > --- a/mm/debug_vm_pgtable.c > +++ b/mm/debug_vm_pgtable.c > @@ -28,6 +28,7 @@ > #include > #include > #include > +#include > #include > #include > =20 > @@ -206,11 +207,12 @@ static void __init pmd_leaf_tests(unsigned long p= fn, pgprot_t prot) > WARN_ON(!pmd_leaf(pmd)); > } > =20 > +#ifdef CONFIG_HAVE_ARCH_HUGE_VMAP > static void __init pmd_huge_tests(pmd_t *pmdp, unsigned long pfn, pgp= rot_t prot) > { > pmd_t pmd; > =20 > - if (!IS_ENABLED(CONFIG_HAVE_ARCH_HUGE_VMAP)) > + if (!arch_ioremap_pmd_supported()) What about moving ioremap_pmd_enabled() from mm/ioremap.c to some .h,=20 and using it ? As ioremap_pmd_enabled() is defined at all time, no need of #ifdef > return; > =20 > pr_debug("Validating PMD huge\n"); > @@ -224,6 +226,9 @@ static void __init pmd_huge_tests(pmd_t *pmdp, unsi= gned long pfn, pgprot_t prot) > pmd =3D READ_ONCE(*pmdp); > WARN_ON(!pmd_none(pmd)); > } > +#else /* CONFIG_HAVE_ARCH_HUGE_VMAP */ > +static void __init pmd_huge_tests(pmd_t *pmdp, unsigned long pfn, pgpr= ot_t prot) { } > +#endif /* CONFIG_HAVE_ARCH_HUGE_VMAP */ > =20 > static void __init pmd_savedwrite_tests(unsigned long pfn, pgprot_t p= rot) > { > @@ -320,11 +325,12 @@ static void __init pud_leaf_tests(unsigned long p= fn, pgprot_t prot) > WARN_ON(!pud_leaf(pud)); > } > =20 > +#ifdef CONFIG_HAVE_ARCH_HUGE_VMAP > static void __init pud_huge_tests(pud_t *pudp, unsigned long pfn, pgp= rot_t prot) > { > pud_t pud; > =20 > - if (!IS_ENABLED(CONFIG_HAVE_ARCH_HUGE_VMAP)) > + if (!arch_ioremap_pud_supported()) What about moving ioremap_pud_enabled() from mm/ioremap.c to some .h,=20 and using it ? As ioremap_pud_enabled() is defined at all time, no need of #ifdef > return; > =20 > pr_debug("Validating PUD huge\n"); > @@ -338,6 +344,10 @@ static void __init pud_huge_tests(pud_t *pudp, uns= igned long pfn, pgprot_t prot) > pud =3D READ_ONCE(*pudp); > WARN_ON(!pud_none(pud)); > } > +#else /* !CONFIG_HAVE_ARCH_HUGE_VMAP */ > +static void __init pud_huge_tests(pud_t *pudp, unsigned long pfn, pgpr= ot_t prot) { } > +#endif /* !CONFIG_HAVE_ARCH_HUGE_VMAP */ > + > #else /* !CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD */ > static void __init pud_basic_tests(unsigned long pfn, pgprot_t prot) = { } > static void __init pud_advanced_tests(struct mm_struct *mm, >=20 Christophe