lkml.org 
[lkml]   [2023]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] mm/gup: disallow GUP writing to file-backed mappings by default
On Mon, Apr 24, 2023 at 08:17:11PM -0300, Jason Gunthorpe wrote:
> 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.
>

That's a very good point! Passing things back with a spinlock held feels
pretty icky though, and obviously a no-go for a FOLL_PIN. Perhaps for a
FOLL_GET this would be workable.

> > 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..
>

OK, I'll respin this as a v3 of this series then since we'll be defaulting
FOLL_LONGTERM at least (for which there seems to be broad consensus), but
also permit this flag to be set manually and set it for io_uring.

> Jason

\
 
 \ /
  Last update: 2023-04-25 01:27    [W:0.040 / U:24.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site