[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <u7dta4gc7h3bkugxchev5k2qlk5yzn5aygkkggmh75ppu6edho@tcc3zbby43un>
Date: Mon, 14 Jul 2025 10:43:58 -0400
From: "Liam R. Howlett" <Liam.Howlett@...cle.com>
To: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
David Hildenbrand <david@...hat.com>, Vlastimil Babka <vbabka@...e.cz>,
Jann Horn <jannh@...gle.com>, Pedro Falcato <pfalcato@...e.de>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/vma: refactor vma_modify_flags_name() to
vma_modify_name()
* Lorenzo Stoakes <lorenzo.stoakes@...cle.com> [250714 09:58]:
> The single instance in which we use this function doesn't actually need to
> change VMA flags, so remove this parameter and update the caller
> accordingly.
>
> Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
David already pointed out the document fix, so it looks good.
Reviewed-by: Liam R. Howlett <Liam.Howlett@...cle.com>
> ---
> mm/madvise.c | 4 ++--
> mm/vma.c | 4 +---
> mm/vma.h | 15 +++++++--------
> 3 files changed, 10 insertions(+), 13 deletions(-)
>
> diff --git a/mm/madvise.c b/mm/madvise.c
> index 9de9b7c797c6..afa9e4db2adb 100644
> --- a/mm/madvise.c
> +++ b/mm/madvise.c
> @@ -162,8 +162,8 @@ static int madvise_update_vma(vm_flags_t new_flags,
> return 0;
>
> if (set_new_anon_name)
> - vma = vma_modify_flags_name(&vmi, madv_behavior->prev, vma,
> - range->start, range->end, new_flags, anon_name);
> + vma = vma_modify_name(&vmi, madv_behavior->prev, vma,
> + range->start, range->end, anon_name);
> else
> vma = vma_modify_flags(&vmi, madv_behavior->prev, vma,
> range->start, range->end, new_flags);
> diff --git a/mm/vma.c b/mm/vma.c
> index b3d880652359..fc502b741dcf 100644
> --- a/mm/vma.c
> +++ b/mm/vma.c
> @@ -1650,17 +1650,15 @@ struct vm_area_struct *vma_modify_flags(
> }
>
> struct vm_area_struct
> -*vma_modify_flags_name(struct vma_iterator *vmi,
> +*vma_modify_name(struct vma_iterator *vmi,
> struct vm_area_struct *prev,
> struct vm_area_struct *vma,
> unsigned long start,
> unsigned long end,
> - vm_flags_t vm_flags,
> struct anon_vma_name *new_name)
> {
> VMG_VMA_STATE(vmg, vmi, prev, vma, start, end);
>
> - vmg.vm_flags = vm_flags;
> vmg.anon_name = new_name;
>
> return vma_modify(&vmg);
> diff --git a/mm/vma.h b/mm/vma.h
> index cf6e3a6371b6..acdcc515c459 100644
> --- a/mm/vma.h
> +++ b/mm/vma.h
> @@ -290,15 +290,14 @@ __must_check struct vm_area_struct
> unsigned long start, unsigned long end,
> vm_flags_t vm_flags);
>
> -/* We are about to modify the VMA's flags and/or anon_name. */
> +/* We are about to modify the VMA's anon_name. */
> __must_check struct vm_area_struct
> -*vma_modify_flags_name(struct vma_iterator *vmi,
> - struct vm_area_struct *prev,
> - struct vm_area_struct *vma,
> - unsigned long start,
> - unsigned long end,
> - vm_flags_t vm_flags,
> - struct anon_vma_name *new_name);
> +*vma_modify_name(struct vma_iterator *vmi,
> + struct vm_area_struct *prev,
> + struct vm_area_struct *vma,
> + unsigned long start,
> + unsigned long end,
> + struct anon_vma_name *new_name);
>
> /* We are about to modify the VMA's memory policy. */
> __must_check struct vm_area_struct
> --
> 2.50.1
>
Powered by blists - more mailing lists