Re: [PATCH 1/3] mm/memory: move pte_install_uffd_wp_if_needed() into memory.c

From: David Hildenbrand (Arm)

Date: Thu Jul 16 2026 - 05:40:08 EST


On 7/15/26 13:18, Dev Jain wrote:
> pte_install_uffd_wp_if_needed() has grown too large for mm_inline.h.
> Move it to memory.c.
>
> While at it, convert the comment to kerneldoc and rename the local
> arguments from pte/pteval to ptep/pte so the pointer and pte value
> are easier to distinguish.
>
> Signed-off-by: Dev Jain <dev.jain@xxxxxxx>
> ---
> include/linux/mm.h | 2 ++
> include/linux/mm_inline.h | 53 ----------------------------------
> mm/memory.c | 60 +++++++++++++++++++++++++++++++++++++++
> 3 files changed, 62 insertions(+), 53 deletions(-)
>
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 550fb92957d18..a71341c44655e 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -5406,4 +5406,6 @@ void map_anon_folio_pte_nopf(struct folio *folio, pte_t *pte,
> struct vm_area_struct *vma, unsigned long addr,
> bool uffd_wp);
>
> +bool pte_install_uffd_wp_if_needed(struct vm_area_struct *vma,
> + unsigned long addr, pte_t *ptep, pte_t pte);

This could probably go to mm/internal.h instead?

Apart from that LGTM.

--
Cheers,

David