From: Pedro Falcato <pfalcato@suse.de>
To: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
"Liam R . Howlett" <Liam.Howlett@oracle.com>,
Vlastimil Babka <vbabka@suse.cz>, Jann Horn <jannh@google.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/mremap: correctly account old mapping after MREMAP_DONTUNMAP remap
Date: Tue, 14 Oct 2025 10:41:18 +0100 [thread overview]
Message-ID: <rtdubi5ewzrptvl25zcdg6ta46kcd6ixowaguftwo3rtmx5cz7@f4sj33igjuic> (raw)
In-Reply-To: <20251013165836.273113-1-lorenzo.stoakes@oracle.com>
On Mon, Oct 13, 2025 at 05:58:36PM +0100, Lorenzo Stoakes wrote:
> Commit b714ccb02a76 ("mm/mremap: complete refactor of move_vma()")
> mistakenly introduced a new behaviour - clearing the VM_ACCOUNT flag of the
> old mapping when a mapping is mremap()'d with the MREMAP_DONTUNMAP flag
> set.
>
> While we always clear the VM_LOCKED and VM_LOCKONFAULT flags for the old
> mapping (the page tables have been moved, so there is no data that could
> possibly be locked in memor), there is no reason to touch any other VMA
memory
> flags.
>
> This is because after the move the old mapping is in a state as if it were
> freshly mapped. This implies that the attributes of the mapping ought to
> remain the same, including whether or not the mapping is accounted.
>
> Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reviewed-by: Pedro Falcato <pfalcato@suse.de>
Looks good, thanks! Should we add a test for it?
--
Pedro
next prev parent reply other threads:[~2025-10-14 9:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-13 16:58 Lorenzo Stoakes
2025-10-14 9:41 ` Pedro Falcato [this message]
2025-10-14 9:57 ` Lorenzo Stoakes
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=rtdubi5ewzrptvl25zcdg6ta46kcd6ixowaguftwo3rtmx5cz7@f4sj33igjuic \
--to=pfalcato@suse.de \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=jannh@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=vbabka@suse.cz \
/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