All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Anshuman Khandual <anshuman.khandual@arm.com>, linux-mm@kvack.org
Cc: mike.kravetz@oracle.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: Re: [PATCH V2] mm/debug_vm_pgtable: Replace pte_mkhuge() with arch_make_huge_pte()
Date: Thu, 2 Mar 2023 13:42:21 +0100	[thread overview]
Message-ID: <d4895edc-a7de-239b-e452-c64535b68685@redhat.com> (raw)
In-Reply-To: <20230302114845.421674-1-anshuman.khandual@arm.com>

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 ...

-- 
Thanks,

David / dhildenb


  reply	other threads:[~2023-03-02 12:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-02 11:48 [PATCH V2] mm/debug_vm_pgtable: Replace pte_mkhuge() with arch_make_huge_pte() Anshuman Khandual
2023-03-02 12:42 ` David Hildenbrand [this message]
2023-03-03 10:12   ` Mike Rapoport

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d4895edc-a7de-239b-e452-c64535b68685@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=anshuman.khandual@arm.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    --cc=rppt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.