Re: [PATCH RFC 0/5] mm: GUP dirty + ->release_folio() fixes

From: Christoph Hellwig

Date: Wed Nov 25 2026 - 02:36:29 EST


On Tue, Nov 24, 2026 at 01:37:43PM +0000, Pedro Falcato wrote:
> > pin_user_pages() was specifically introduced for this exact class of
> > problem. get_user_pages() is now meant for other, much more limited cases.
> > I've attempted to document that, here:
> >
> > https://docs.kernel.org/core-api/pin_user_pages.html
>
> Ok, so I guess you want me to drop the hacks to make GUP FOLL_WRITE not
> screw itself over? To be clear, the rest is still broken, even with pin_user_pages().
> It just means we get nicer looking fixes, and I can drop patch 3.

Yes. And maybe start looking into fixing GUP FOLL_WRITE users if there
are any that you ran into or which are relevant to your workload.

> It's unclear (to me) whether we care about any straggling get_user_pages
> FOLL_WRITE users. A quick look around doesn't find me many; most seem to have
> been converted to pin_user_pages() (though, admittedly, I don't know how many
> of these are converted in stable; do we care?). Perhaps piling on a patch
> to simply disallow get_user_pages(FOLL_WRITE) is ok? Giving Lorenzo's idea
> a go again :)

I fear this is going to to break quite a lot of things. Although given
how long we've asked about this maybe we should at least send a patch
to it with all relevant maintainers Cced and queue it up in -next for
a while.