[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f00a062a-8941-4cdb-975e-c13aad860168@lucifer.local>
Date: Mon, 17 Nov 2025 19:57:30 +0000
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
To: Andrei Vagin <avagin@...il.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
David Hildenbrand <david@...nel.org>,
"Liam R . Howlett" <Liam.Howlett@...cle.com>,
Vlastimil Babka <vbabka@...e.cz>, Mike Rapoport <rppt@...nel.org>,
Suren Baghdasaryan <surenb@...gle.com>, Michal Hocko <mhocko@...e.com>,
Jann Horn <jannh@...gle.com>, Pedro Falcato <pfalcato@...e.de>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org, criu@...ts.linux.dev,
Cyrill Gorcunov <gorcunov@...il.com>
Subject: Re: [PATCH 0/2] make VM_SOFTDIRTY a sticky VMA flag
On Mon, Nov 17, 2025 at 10:26:34AM -0800, Andrei Vagin wrote:
> On Mon, Nov 17, 2025 at 3:33 AM Lorenzo Stoakes
> <lorenzo.stoakes@...cle.com> wrote:
> >
> > On Sun, Nov 16, 2025 at 04:53:36PM -0800, Andrei Vagin wrote:
> > > On Fri, Nov 14, 2025 at 9:59 AM Lorenzo Stoakes
> > > <lorenzo.stoakes@...cle.com> wrote:
> > > >
> > > > Currently we set VM_SOFTDIRTY when a new mapping is set up (whether by
> > > > establishing a new VMA, or via merge) as implemented in __mmap_complete()
> > > > and do_brk_flags().
> > > >
> > > > However, when performing a merge of existing mappings such as when
> > > > performing mprotect(), we may lose the VM_SOFTDIRTY flag.
> > >
> > > Losing VM_SOFTDIRTY is definitely a bug, thank you for fixing it.
> > >
> > > A separate concern is whether merging two VMAs should be permitted when
> > > one has the VM_SOFTDIRTY flag set and another does not. I think the
> > > merging operation should be disallowed.The issue is that
> >
> >
> > This patch doesn't change anything in terms of merging, it only _correctly_
> > marks VMAs as soft-dirty where certain, very specific, circumstances might
> > result in a merged VMA being incorrectly indicated to not be soft-dirty
> > when it in fact contains pages which are.
>
> As I mentioned in the previous message, this patch is correct, and I
> appreciate your effort to solve this issue. My comment was about whether
> we should allow merging VMAs if one has VM_SOFTDIRTY and the other does
> not. You are right, this is a separate question unrelated to this patch.
Thanks :)
>
> I recall correctly that initially, merging vma-s with different
> VM_SORTDIRTY bit values was not allowed. It was a bit surprising that
> this behavior was changed by Cyrill in 34228d473efe. Cyrill was an
> active CRIU contributor at the time, so we can't even blame anyone for
> breaking CRIU :).
Well I think Cyrill is in the right here :) the problem described there -
that of hitting the max_map_count simply due to failed VM_SOFTDIRTY merges
- is very serious and clearly highlights the issue that arises from not
merging these - that is VMA fragmentation.
>
> Thanks,
> Andrei
Cheers, Lorenzo
Powered by blists - more mailing lists