[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANaxB-zPuxtbpt7wcjDE1X5nv4yWp=JTq_MqWSfDce2gx-WKiA@mail.gmail.com>
Date: Mon, 17 Nov 2025 10:26:34 -0800
From: Andrei Vagin <avagin@...il.com>
To: Lorenzo Stoakes <lorenzo.stoakes@...cle.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 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.
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 :).
Thanks,
Andrei
Powered by blists - more mailing lists