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 02:43:56AM -0700, Christoph Hellwig wrote:
> I'm pretty sure DIRECT I/O reads that write into file backed mappings
> are out there in the wild.
>
> So while I wish we had never allowed this, the exercise seems futile and
> instead we need to work on supporting this usecase, with the FOLL_PIN
> infrastructure being a big step toward that.

It's not entirely futile, there's at least one specific use case, which is
io_uring which is currently open coding an equivalent check themselves. By
introducing this change we prevent them from having to do so and provide a
means by which other callers who implicitly need this do not have to do so
either.

In addition, this change frees up a blocked patch series intending to clean
up GUP which should help open the door to further improvements across the
system.

So I would argue certainly not futile.

In addition, I think it's useful to explicitly document that this is a
broken case and, through use of the flag, highlight places which are
problematic (although perhaps not exhaustively).

I know Jason is keen on fixing this at a fundamental level and this flag is
ultimately his suggestion, so it certainly doesn't stand in the way of this
work moving forward.

\
 
 \ /
  Last update: 2023-04-24 12:19    [W:0.063 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site