[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CA+EESO7E9r08KaMXNT+kdyCkpxLftSu4KFL09urLuu3Syw9=4A@mail.gmail.com>
Date: Thu, 8 May 2025 15:00:36 -0700
From: Lokesh Gidra <lokeshgidra@...gle.com>
To: Barry Song <21cnbao@...il.com>
Cc: Peter Xu <peterx@...hat.com>, akpm@...ux-foundation.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, Barry Song <v-songbaohua@...o.com>,
David Hildenbrand <david@...hat.com>, Suren Baghdasaryan <surenb@...gle.com>,
Kalesh Singh <kaleshsingh@...gle.com>
Subject: Re: [PATCH RFC] mm: userfaultfd: correct dirty flags set for both
present and swap pte
On Thu, May 8, 2025 at 2:36 PM Barry Song <21cnbao@...il.com> wrote:
>
> On Fri, May 9, 2025 at 3:27 AM Lokesh Gidra <lokeshgidra@...gle.com> wrote:
> >
> > Thanks Barry for fixing this.
> >
> > On Thu, May 8, 2025 at 8:24 AM Peter Xu <peterx@...hat.com> wrote:
> > >
> > > On Thu, May 08, 2025 at 09:07:35PM +1200, Barry Song wrote:
> > > > From: Barry Song <v-songbaohua@...o.com>
> > > >
> > > > As David pointed out, what truly matters for mremap and userfaultfd
> > > > move operations is the soft dirty bit. The current comment and
> > > > implementation—which always sets the dirty bit for present PTEs
> > > > and fails to set the soft dirty bit for swap PTEs—are incorrect.
> >
> > Can you please briefly describe the consequences of not setting the
> > soft-dirty bit? I'm wondering if it needs to be backported as a fix?
>
> As I understand it, this could break features like Checkpoint-Restore
> in Userspace (CRIU), which relies on tracking memory changes to create
> incremental dumps. While Android may not currently have a real-world
> use case for this, it would still be beneficial to backport the fix in
> a general way.
>
Makes sense. Thanks for clarifying.
> >
> > > > This patch updates the behavior to correctly set the soft dirty bit
> > > > for both present and swap PTEs in accordance with mremap.
> > > >
> > > > Reported-by: David Hildenbrand <david@...hat.com>
> > > > Closes: https://lore.kernel.org/linux-mm/02f14ee1-923f-47e3-a994-4950afb9afcc@redhat.com/
> > > > Cc: Peter Xu <peterx@...hat.com>
> > > > Cc: Suren Baghdasaryan <surenb@...gle.com>
> > > > Cc: Lokesh Gidra <lokeshgidra@...gle.com>
> > > > Signed-off-by: Barry Song <v-songbaohua@...o.com>
> > >
> > > Acked-by: Peter Xu <peterx@...hat.com>
> > >
> > > --
> > > Peter Xu
>
> Thanks
> Barry
Powered by blists - more mailing lists