From: Alexander Gordeev <agordeev@linux.ibm.com>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: linux-mm@kvack.org, linux-arch@vger.kernel.org, x86@kernel.org,
linux-s390@vger.kernel.org, sparclinux@vger.kernel.org,
linux-um@lists.infradead.org
Subject: Re: [PATCH 2/7] mm: Introduce a common definition of mk_pte()
Date: Wed, 19 Feb 2025 10:07:36 +0100 [thread overview]
Message-ID: <Z7WfWLAvX5fn90aN@li-008a6a4c-3549-11b2-a85c-c5cc2836eea2.ibm.com> (raw)
In-Reply-To: <20250217190836.435039-3-willy@infradead.org>
On Mon, Feb 17, 2025 at 07:08:29PM +0000, Matthew Wilcox (Oracle) wrote:
> Most architectures simply call pfn_pte(). Centralise that as the normal
> definition and remove the definition of mk_pte() from the architectures
> which have either that exact definition or something similar.
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
...
> arch/s390/include/asm/pgtable.h | 5 -----
...
> include/linux/mm.h | 9 +++++++++
> 22 files changed, 10 insertions(+), 99 deletions(-)
>
...
> diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
> index 3ee495b5171e..db932beabc87 100644
> --- a/arch/s390/include/asm/pgtable.h
> +++ b/arch/s390/include/asm/pgtable.h
> @@ -1449,11 +1449,6 @@ static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
> return pte_mkyoung(__pte);
> }
>
> -static inline pte_t mk_pte(struct page *page, pgprot_t pgprot)
> -{
> - return mk_pte_phys(page_to_phys(page), pgprot);
> -}
> -
> #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
> #define p4d_index(address) (((address) >> P4D_SHIFT) & (PTRS_PER_P4D-1))
> #define pud_index(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
...
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 7b1068ddcbb7..3ef11ff3922f 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -1916,6 +1916,15 @@ static inline struct folio *pfn_folio(unsigned long pfn)
> return page_folio(pfn_to_page(pfn));
> }
>
> +#ifndef mk_pte
> +#ifdef CONFIG_MMU
> +static inline pte_t mk_pte(struct page *page, pgprot_t pgprot)
> +{
> + return pfn_pte(page_to_pfn(page), pgprot);
> +}
> +#endif
> +#endif
> +
> /**
> * folio_maybe_dma_pinned - Report if a folio may be pinned for DMA.
> * @folio: The folio.
For s390:
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Thanks!
next prev parent reply other threads:[~2025-02-19 9:07 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-17 19:08 [PATCH 0/7] Add folio_mk_pte() and simplify mk_pte() Matthew Wilcox (Oracle)
2025-02-17 19:08 ` [PATCH 1/7] mm: Set the pte dirty if the folio is already dirty Matthew Wilcox (Oracle)
2025-02-18 10:31 ` David Hildenbrand
2025-02-18 16:20 ` Alexander Gordeev
2025-02-18 17:06 ` Matthew Wilcox
2025-02-19 7:27 ` Alexander Gordeev
2025-02-19 7:33 ` Alexander Gordeev
2025-02-19 8:46 ` Alexander Gordeev
2025-02-17 19:08 ` [PATCH 2/7] mm: Introduce a common definition of mk_pte() Matthew Wilcox (Oracle)
2025-02-18 8:15 ` Geert Uytterhoeven
2025-02-18 10:32 ` David Hildenbrand
2025-02-19 9:07 ` Alexander Gordeev [this message]
2025-02-17 19:08 ` [PATCH 3/7] sparc32: Remove custom " Matthew Wilcox (Oracle)
2025-02-17 19:08 ` [PATCH 4/7] x86: " Matthew Wilcox (Oracle)
2025-02-19 20:53 ` Dave Hansen
2025-02-17 19:08 ` [PATCH 5/7] um: " Matthew Wilcox (Oracle)
2025-02-17 19:08 ` [PATCH 6/7] mm: Make mk_pte() definition unconditional Matthew Wilcox (Oracle)
2025-02-18 10:32 ` David Hildenbrand
2025-02-17 19:08 ` [PATCH 7/7] mm: Add folio_mk_pte() Matthew Wilcox (Oracle)
2025-02-18 10:33 ` David Hildenbrand
2025-02-18 10:29 ` [PATCH 0/7] Add folio_mk_pte() and simplify mk_pte() David Hildenbrand
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=Z7WfWLAvX5fn90aN@li-008a6a4c-3549-11b2-a85c-c5cc2836eea2.ibm.com \
--to=agordeev@linux.ibm.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux-um@lists.infradead.org \
--cc=sparclinux@vger.kernel.org \
--cc=willy@infradead.org \
--cc=x86@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox