Re: [PATCH] mm/gup: Drain batched mlock folio processing before attempting migration
From: Hugh Dickins
Date: Fri Aug 29 2025 - 12:05:14 EST
On Fri, 29 Aug 2025, Will Deacon wrote:
> On Fri, Aug 29, 2025 at 12:57:43PM +0100, Will Deacon wrote:
> > On Thu, Aug 28, 2025 at 01:47:14AM -0700, Hugh Dickins wrote:
> > > Patch is against 6.17-rc3; but if you'd prefer the patch against 6.12
> > > (or an intervening release), I already did the backport so please just
> > > ask.
> >
> > We've got 6.15 working well at the moment, so I'll backport your diff
> > to that.
>
> Notwithstanding my question about the synchronisation, I cherry-picked
> 86ebd50224c0 ("mm: add folio_expected_ref_count() for reference count
> calculation") to my 6.15-based Android tree and applied your diff on top.
Yes, I cherry-picked exactly that into my 6.12. Not a big deal,
but a word of advance warning: the first patch in my series will
(I believe) be a fix to that folio_expected_ref_count(), to allow
for PG_private_2, which implies +1 on refcount (I've not yet
researched whether it's +1 or +2 if PG_private and PG_private_2
are both set - comments I've seen imply +1 but I need to check).
I thought of that when doing the cherry-pick because I thought that
PG_private_2 had already been killed off by now in the latest tree:
but was surprised to find that it is still there in 6.17-rc.
>
> With that, I've not managed to reproduce the original failure and
> haven't observed any migration failures on the GUP path.
Great, many thanks to you, Will.
Hugh