Message ID | 20230302114845.421674-1-anshuman.khandual@arm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp4192620wrd; Thu, 2 Mar 2023 03:59:34 -0800 (PST) X-Google-Smtp-Source: AK7set+iOc25VMhhjH/4xXacIsVWx3zww3hDXivkSDtDWsplpbJGNCqBVIqSVZrX+wQPo+eYhHRT X-Received: by 2002:a17:90a:598b:b0:237:47b0:3235 with SMTP id l11-20020a17090a598b00b0023747b03235mr11524281pji.32.1677758373910; Thu, 02 Mar 2023 03:59:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677758373; cv=none; d=google.com; s=arc-20160816; b=Wy4eB/MYZqsP+lexBp0Sz3V/U/EomaierUyJZxaedX6zRpyhYvoA44HCmGril1sx2M 4xdTscIfr4Fa8RKFitPrZm36s7IauXv7gWZ8sX8AGenUdFBTSu3PT2PCoHw51q8HpN3p GHHseUu8Ix/QokZhwhmvOXfJjt7nBe6TxemhRnkReNy/JHCR9xYyoypaM5lkTPfPUXiw lKrPJvaG064myMOov6wjp1+/UjGYa84EFRT5qlMvlbT5zRBgpxL53XXHNg7PIIHAk+Be n22covHfCw+QcdD9vfzCq9hQ4+1sPnjG0bwDxGzcPlJvXMbeEkQRVIyDcfHs+KtqameV 7HiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=c7mzOY3mMVPzSIyrOKgLa3tOsXt32PdzPhh9wBP+ixk=; b=g2PfX29kteQz5Nu0vwBWqX/GoAUC6GgdcOaNIRXktkY5TeuIQ/GmO1ftzGV9RSmEP3 Ha29g23iyfscdBRHM61LVoaldgKp8YxVj1XVWQnKtShvAfyoXesqjz1S3p2XqLQekqps xixRpyn+bRIBSYYmLg977Rf0RjdG0OHsvH/RGh6xWF6ZgX+HeSzFo0Zu5knO9VwoELb4 pqHJz1S6Pxk9AoTDWF0GKgAWwx4BrDISptZ7/FQ1LlSmuWj/OVwTgzqqwSJUAq6IhNgG S7uk1F9auBf+COO3m5SLTUe1PFKUAzpfevKatVqP7z64VFtxh4yf91QxuW3DZh06Fdi4 YoPw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j63-20020a638b42000000b004fb27746031si14934480pge.829.2023.03.02.03.59.21; Thu, 02 Mar 2023 03:59:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229713AbjCBLs7 (ORCPT <rfc822;davidbtadokoro@gmail.com> + 99 others); Thu, 2 Mar 2023 06:48:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjCBLs6 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 2 Mar 2023 06:48:58 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C4F547ED1; Thu, 2 Mar 2023 03:48:56 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A93BC1FB; Thu, 2 Mar 2023 03:49:39 -0800 (PST) Received: from a077893.arm.com (unknown [10.163.85.162]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 277B23F587; Thu, 2 Mar 2023 03:48:52 -0800 (PST) From: Anshuman Khandual <anshuman.khandual@arm.com> To: linux-mm@kvack.org Cc: david@redhat.com, mike.kravetz@oracle.com, Anshuman Khandual <anshuman.khandual@arm.com>, Jonathan Corbet <corbet@lwn.net>, Andrew Morton <akpm@linux-foundation.org>, "Mike Rapoport (IBM)" <rppt@kernel.org>, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Christophe Leroy <christophe.leroy@csgroup.eu> Subject: [PATCH V2] mm/debug_vm_pgtable: Replace pte_mkhuge() with arch_make_huge_pte() Date: Thu, 2 Mar 2023 17:18:45 +0530 Message-Id: <20230302114845.421674-1-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759224581215997077?= X-GMAIL-MSGID: =?utf-8?q?1759257164184599745?= |
Series |
[V2] mm/debug_vm_pgtable: Replace pte_mkhuge() with arch_make_huge_pte()
|
|
Commit Message
Anshuman Khandual
March 2, 2023, 11:48 a.m. UTC
Since the following commit arch_make_huge_pte() should be used directly in
generic memory subsystem as a platform provided page table helper, instead
of pte_mkhuge(). Change hugetlb_basic_tests() to call arch_make_huge_pte()
directly, and update its relevant documentation entry as required.
'commit 16785bd77431 ("mm: merge pte_mkhuge() call into arch_make_huge_pte()")'
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: "Mike Rapoport (IBM)" <rppt@kernel.org>
Cc: linux-doc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org
Reported-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/all/1ea45095-0926-a56a-a273-816709e9075e@csgroup.eu/
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
---
This applies on latest mainline.
Changes in V2:
- Send PMD_SHIFT and VM_ACCESS_FLAGS as arguments for arch_make_huge_pte()
Changes in V1:
https://lore.kernel.org/all/20230302031833.360679-1-anshuman.khandual@arm.com/
Documentation/mm/arch_pgtable_helpers.rst | 2 +-
mm/debug_vm_pgtable.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Comments
On 02.03.23 12:48, Anshuman Khandual wrote: > Since the following commit arch_make_huge_pte() should be used directly in > generic memory subsystem as a platform provided page table helper, instead > of pte_mkhuge(). Change hugetlb_basic_tests() to call arch_make_huge_pte() > directly, and update its relevant documentation entry as required. > > 'commit 16785bd77431 ("mm: merge pte_mkhuge() call into arch_make_huge_pte()")' > > Cc: Jonathan Corbet <corbet@lwn.net> > Cc: Andrew Morton <akpm@linux-foundation.org> > Cc: "Mike Rapoport (IBM)" <rppt@kernel.org> > Cc: linux-doc@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Cc: linux-mm@kvack.org > Reported-by: Christophe Leroy <christophe.leroy@csgroup.eu> > Link: https://lore.kernel.org/all/1ea45095-0926-a56a-a273-816709e9075e@csgroup.eu/ > Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> > --- > This applies on latest mainline. > > Changes in V2: > > - Send PMD_SHIFT and VM_ACCESS_FLAGS as arguments for arch_make_huge_pte() > > Changes in V1: > > https://lore.kernel.org/all/20230302031833.360679-1-anshuman.khandual@arm.com/ > > Documentation/mm/arch_pgtable_helpers.rst | 2 +- > mm/debug_vm_pgtable.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/Documentation/mm/arch_pgtable_helpers.rst b/Documentation/mm/arch_pgtable_helpers.rst > index 30d9a09f01f4..af3891f895b0 100644 > --- a/Documentation/mm/arch_pgtable_helpers.rst > +++ b/Documentation/mm/arch_pgtable_helpers.rst > @@ -214,7 +214,7 @@ HugeTLB Page Table Helpers > +---------------------------+--------------------------------------------------+ > | pte_huge | Tests a HugeTLB | > +---------------------------+--------------------------------------------------+ > -| pte_mkhuge | Creates a HugeTLB | > +| arch_make_huge_pte | Creates a HugeTLB | > +---------------------------+--------------------------------------------------+ > | huge_pte_dirty | Tests a dirty HugeTLB | > +---------------------------+--------------------------------------------------+ > diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c > index af59cc7bd307..7887cc2b75bf 100644 > --- a/mm/debug_vm_pgtable.c > +++ b/mm/debug_vm_pgtable.c > @@ -934,7 +934,7 @@ static void __init hugetlb_basic_tests(struct pgtable_debug_args *args) > #ifdef CONFIG_ARCH_WANT_GENERAL_HUGETLB > pte = pfn_pte(args->fixed_pmd_pfn, args->page_prot); > > - WARN_ON(!pte_huge(pte_mkhuge(pte))); > + WARN_ON(!pte_huge(arch_make_huge_pte(pte, PMD_SHIFT, VM_ACCESS_FLAGS))); > #endif /* CONFIG_ARCH_WANT_GENERAL_HUGETLB */ > } > #else /* !CONFIG_HUGETLB_PAGE */ IMHO, it's a bit weird that we are starting to call these things "arch_*". PTE operations like these are already mostly arch-specific helpers with custom implementations (and some generic ones in asm-generic as a fallback). So this one certainly sticks out now ... anyhow, change itself LGTM ...
On Thu, Mar 02, 2023 at 01:42:21PM +0100, David Hildenbrand wrote: > On 02.03.23 12:48, Anshuman Khandual wrote: > > Since the following commit arch_make_huge_pte() should be used directly in > > generic memory subsystem as a platform provided page table helper, instead > > of pte_mkhuge(). Change hugetlb_basic_tests() to call arch_make_huge_pte() > > directly, and update its relevant documentation entry as required. > > > > 'commit 16785bd77431 ("mm: merge pte_mkhuge() call into arch_make_huge_pte()")' > > > > Cc: Jonathan Corbet <corbet@lwn.net> > > Cc: Andrew Morton <akpm@linux-foundation.org> > > Cc: "Mike Rapoport (IBM)" <rppt@kernel.org> > > Cc: linux-doc@vger.kernel.org > > Cc: linux-kernel@vger.kernel.org > > Cc: linux-mm@kvack.org > > Reported-by: Christophe Leroy <christophe.leroy@csgroup.eu> > > Link: https://lore.kernel.org/all/1ea45095-0926-a56a-a273-816709e9075e@csgroup.eu/ > > Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> > > --- > > This applies on latest mainline. > > > > Changes in V2: > > > > - Send PMD_SHIFT and VM_ACCESS_FLAGS as arguments for arch_make_huge_pte() > > Changes in V1: > > > > https://lore.kernel.org/all/20230302031833.360679-1-anshuman.khandual@arm.com/ > > > > Documentation/mm/arch_pgtable_helpers.rst | 2 +- > > mm/debug_vm_pgtable.c | 2 +- > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/Documentation/mm/arch_pgtable_helpers.rst b/Documentation/mm/arch_pgtable_helpers.rst > > index 30d9a09f01f4..af3891f895b0 100644 > > --- a/Documentation/mm/arch_pgtable_helpers.rst > > +++ b/Documentation/mm/arch_pgtable_helpers.rst > > @@ -214,7 +214,7 @@ HugeTLB Page Table Helpers > > +---------------------------+--------------------------------------------------+ > > | pte_huge | Tests a HugeTLB | > > +---------------------------+--------------------------------------------------+ > > -| pte_mkhuge | Creates a HugeTLB | > > +| arch_make_huge_pte | Creates a HugeTLB | > > +---------------------------+--------------------------------------------------+ > > | huge_pte_dirty | Tests a dirty HugeTLB | > > +---------------------------+--------------------------------------------------+ > > diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c > > index af59cc7bd307..7887cc2b75bf 100644 > > --- a/mm/debug_vm_pgtable.c > > +++ b/mm/debug_vm_pgtable.c > > @@ -934,7 +934,7 @@ static void __init hugetlb_basic_tests(struct pgtable_debug_args *args) > > #ifdef CONFIG_ARCH_WANT_GENERAL_HUGETLB > > pte = pfn_pte(args->fixed_pmd_pfn, args->page_prot); > > - WARN_ON(!pte_huge(pte_mkhuge(pte))); > > + WARN_ON(!pte_huge(arch_make_huge_pte(pte, PMD_SHIFT, VM_ACCESS_FLAGS))); > > #endif /* CONFIG_ARCH_WANT_GENERAL_HUGETLB */ > > } > > #else /* !CONFIG_HUGETLB_PAGE */ > > > IMHO, it's a bit weird that we are starting to call these things "arch_*". > PTE operations like these are already mostly arch-specific helpers with > custom implementations (and some generic ones in asm-generic as a fallback). Yeah, probably a better name for arch_make_huge_pte() would have been pte_make_huge() > So this one certainly sticks out now ... anyhow, change itself LGTM ... > > -- > Thanks, > > David / dhildenb >
diff --git a/Documentation/mm/arch_pgtable_helpers.rst b/Documentation/mm/arch_pgtable_helpers.rst index 30d9a09f01f4..af3891f895b0 100644 --- a/Documentation/mm/arch_pgtable_helpers.rst +++ b/Documentation/mm/arch_pgtable_helpers.rst @@ -214,7 +214,7 @@ HugeTLB Page Table Helpers +---------------------------+--------------------------------------------------+ | pte_huge | Tests a HugeTLB | +---------------------------+--------------------------------------------------+ -| pte_mkhuge | Creates a HugeTLB | +| arch_make_huge_pte | Creates a HugeTLB | +---------------------------+--------------------------------------------------+ | huge_pte_dirty | Tests a dirty HugeTLB | +---------------------------+--------------------------------------------------+ diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index af59cc7bd307..7887cc2b75bf 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -934,7 +934,7 @@ static void __init hugetlb_basic_tests(struct pgtable_debug_args *args) #ifdef CONFIG_ARCH_WANT_GENERAL_HUGETLB pte = pfn_pte(args->fixed_pmd_pfn, args->page_prot); - WARN_ON(!pte_huge(pte_mkhuge(pte))); + WARN_ON(!pte_huge(arch_make_huge_pte(pte, PMD_SHIFT, VM_ACCESS_FLAGS))); #endif /* CONFIG_ARCH_WANT_GENERAL_HUGETLB */ } #else /* !CONFIG_HUGETLB_PAGE */