Re: [PATCH v2] mm/gup: disallow GUP writing to file-backed mappings by default

From: Jason Gunthorpe
Date: Mon Apr 24 2023 - 19:19:06 EST


On Tue, Apr 25, 2023 at 12:03:34AM +0100, Lorenzo Stoakes wrote:

> Except you dirty a page that is mapped elsewhere that thought everything
> was cleaned and... not sure the PTLs really help you much?

If we have a writable PTE then while the PTE's PTL is held it is impossible
for a FS to make the page clean as any cleaning action has to also
take the PTL to make the PTE non-present or non-writable.

> If we want to be more adventerous the opt-in variant could default to on
> for FOLL_LONGTERM too, but that discussion can be had over on that patch
> series.

I think you should at least do this too to explain why io_uring code
is moving into common code..

Jason