[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5f1598d0-3645-4553-a3a4-4b458190ef53@redhat.com>
Date: Mon, 14 Jul 2025 16:27:30 +0200
From: David Hildenbrand <david@...hat.com>
To: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
"Liam R . Howlett" <Liam.Howlett@...cle.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()
On 14.07.25 16:24, Lorenzo Stoakes wrote:
> On Mon, Jul 14, 2025 at 04:18:13PM +0200, David Hildenbrand wrote:
>> On 14.07.25 15:58, Lorenzo Stoakes wrote:
>>> 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>
>>> ---
>>> 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
>>
>> The doc of madvise_update_vma() is a bit misleading:
>>
>> "Update the vm_flags and/or anon_name"
>>
>> I assume it's xor? Do we want to sanity check that this will hold true?
>
> Yeah should be xor, this is just a remnant of a past age :P
>
> No need for sanity check I'd say, as the only code path that does this is very
> specific - with behaviour of __MADV_SET_ANON_VMA_NAME and new_flags not updated
> from vma->vm_flags.
>
> I can send a fix-patch to update the comment for madvise_update_vma().
With that
Acked-by: David Hildenbrand <david@...hat.com>
Cheers buddy!
--
Cheers,
David / dhildenb
Powered by blists - more mailing lists