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.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 770F7C433E7 for ; Wed, 2 Sep 2020 12:53:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2218C206F0 for ; Wed, 2 Sep 2020 12:53:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="hWQr8MzC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2218C206F0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 899646B005C; Wed, 2 Sep 2020 08:53:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 823068E0003; Wed, 2 Sep 2020 08:53:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6C4808E0001; Wed, 2 Sep 2020 08:53:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0171.hostedemail.com [216.40.44.171]) by kanga.kvack.org (Postfix) with ESMTP id 4B6406B005C for ; Wed, 2 Sep 2020 08:53:16 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 1A945362B for ; Wed, 2 Sep 2020 12:53:16 +0000 (UTC) X-FDA: 77218111992.06.act17_430122c270a1 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin06.hostedemail.com (Postfix) with ESMTP id E5CA710065984 for ; Wed, 2 Sep 2020 12:53:15 +0000 (UTC) X-HE-Tag: act17_430122c270a1 X-Filterd-Recvd-Size: 7498 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf27.hostedemail.com (Postfix) with ESMTP for ; Wed, 2 Sep 2020 12:53:15 +0000 (UTC) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 082CgNZl112476; Wed, 2 Sep 2020 08:53:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=HaQXEeOyF7wqvN2uijbpakjvCp3PPYRRihGlyDTCsC0=; b=hWQr8MzCcneBfRwMx+bCW4UJzQ0Vc3BNmGtCp1elBOpS2k+EIKVKkgbuUZDrziIYHkrL aKY9f4enWhExUSmX0WaDQpK9uxBxROeljc/4xpmJFklDqSF2iVaICFh6abbG4U+3noEJ jNvTM3tWiQyAXQjeeyXiGReyOM3+ILiNHmMUDLiN+yr/B4Ttq4bJ8DE7ueZUstVPbAHa ZciKnyFegluMvXj+5DxK1CqpePRrawD94dlU+kQqAwKtwd9aLzDuTneOcuPVoyW82Ptu kGjAs4RuDzY7IBxoOdSTEg2OfomCazehbH01s9R3vqdj4RxxlLzvkG26cnTgrb/+XhWe BQ== Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 33abms89w6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 02 Sep 2020 08:53:08 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 082ClDco000500; Wed, 2 Sep 2020 12:53:07 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma03ams.nl.ibm.com with ESMTP id 337en8cqre-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 02 Sep 2020 12:53:07 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 082CpXqB35062242 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 2 Sep 2020 12:51:33 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DC6C9A4051; Wed, 2 Sep 2020 12:53:04 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BCD81A4040; Wed, 2 Sep 2020 12:53:03 +0000 (GMT) Received: from [9.199.61.124] (unknown [9.199.61.124]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 2 Sep 2020 12:53:03 +0000 (GMT) Subject: Re: [PATCH v4 04/13] mm/debug_vm_pgtables/hugevmap: Use the arch helper to identify huge vmap support. To: Christophe Leroy , 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> <7e88e090-e3af-b26c-ca65-3d98e8f81eb3@csgroup.eu> From: "Aneesh Kumar K.V" Message-ID: Date: Wed, 2 Sep 2020 18:23:02 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <7e88e090-e3af-b26c-ca65-3d98e8f81eb3@csgroup.eu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-09-02_03:2020-09-02,2020-09-02 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 malwarescore=0 suspectscore=0 phishscore=0 clxscore=1015 mlxscore=0 bulkscore=0 mlxlogscore=999 adultscore=0 lowpriorityscore=0 impostorscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009020114 X-Rspamd-Queue-Id: E5CA710065984 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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 9/2/20 6:10 PM, Christophe Leroy wrote: >=20 >=20 > 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=20 >> helper >> to determine the huge vmap support. >> >> Signed-off-by: Aneesh Kumar K.V >> --- >> =C2=A0 mm/debug_vm_pgtable.c | 14 ++++++++++++-- >> =C2=A0 1 file changed, 12 insertions(+), 2 deletions(-) >> >> 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 @@ >> =C2=A0 #include >> =C2=A0 #include >> =C2=A0 #include >> +#include >> =C2=A0 #include >> =C2=A0 #include >> @@ -206,11 +207,12 @@ static void __init pmd_leaf_tests(unsigned long=20 >> pfn, pgprot_t prot) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 WARN_ON(!pmd_leaf(pmd)); >> =C2=A0 } >> +#ifdef CONFIG_HAVE_ARCH_HUGE_VMAP >> =C2=A0 static void __init pmd_huge_tests(pmd_t *pmdp, unsigned long pf= n,=20 >> pgprot_t prot) >> =C2=A0 { >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pmd_t pmd; >> -=C2=A0=C2=A0=C2=A0 if (!IS_ENABLED(CONFIG_HAVE_ARCH_HUGE_VMAP)) >> +=C2=A0=C2=A0=C2=A0 if (!arch_ioremap_pmd_supported()) >=20 > 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 >=20 yes. This was discussed earlier too. IMHO we should do that outside this=20 series. I guess figuring out ioremap_pmd/pud support can definitely be=20 simplified. With a generic version like #ifndef arch_ioremap_pmd_supported static inline bool arch_ioremap_pmd_supported(void) { return false; } #endif >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pr_debug("Validating PMD huge\n"); >> @@ -224,6 +226,9 @@ static void __init pmd_huge_tests(pmd_t *pmdp,=20 >> unsigned long pfn, pgprot_t prot) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pmd =3D READ_ONCE(*pmdp); >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 WARN_ON(!pmd_none(pmd)); >> =C2=A0 } >> +#else /* CONFIG_HAVE_ARCH_HUGE_VMAP */ >> +static void __init pmd_huge_tests(pmd_t *pmdp, unsigned long pfn,=20 >> pgprot_t prot) { } >> +#endif /* CONFIG_HAVE_ARCH_HUGE_VMAP */ >> =C2=A0 static void __init pmd_savedwrite_tests(unsigned long pfn, pgpr= ot_t=20 >> prot) >> =C2=A0 { >> @@ -320,11 +325,12 @@ static void __init pud_leaf_tests(unsigned long=20 >> pfn, pgprot_t prot) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 WARN_ON(!pud_leaf(pud)); >> =C2=A0 } >> +#ifdef CONFIG_HAVE_ARCH_HUGE_VMAP >> =C2=A0 static void __init pud_huge_tests(pud_t *pudp, unsigned long pf= n,=20 >> pgprot_t prot) >> =C2=A0 { >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pud_t pud; >> -=C2=A0=C2=A0=C2=A0 if (!IS_ENABLED(CONFIG_HAVE_ARCH_HUGE_VMAP)) >> +=C2=A0=C2=A0=C2=A0 if (!arch_ioremap_pud_supported()) >=20 > 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 >=20 >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pr_debug("Validating PUD huge\n"); >> @@ -338,6 +344,10 @@ static void __init pud_huge_tests(pud_t *pudp,=20 >> unsigned long pfn, pgprot_t prot) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pud =3D READ_ONCE(*pudp); >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 WARN_ON(!pud_none(pud)); >> =C2=A0 } >> +#else /* !CONFIG_HAVE_ARCH_HUGE_VMAP */ >> +static void __init pud_huge_tests(pud_t *pudp, unsigned long pfn,=20 >> pgprot_t prot) { } >> +#endif /* !CONFIG_HAVE_ARCH_HUGE_VMAP */ >> + >> =C2=A0 #else=C2=A0 /* !CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD */ >> =C2=A0 static void __init pud_basic_tests(unsigned long pfn, pgprot_t = prot)=20 >> { } >> =C2=A0 static void __init pud_advanced_tests(struct mm_struct *mm, >> >=20 > Christophe