[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <90a54439-5d30-4711-8a86-eba816782a66@lucifer.local>
Date: Mon, 24 Apr 2023 11:17:55 +0100
From: Lorenzo Stoakes <lstoakes@...il.com>
To: Christoph Hellwig <hch@...radead.org>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Jason Gunthorpe <jgg@...pe.ca>, Jens Axboe <axboe@...nel.dk>,
Matthew Wilcox <willy@...radead.org>,
Dennis Dalessandro <dennis.dalessandro@...nelisnetworks.com>,
Leon Romanovsky <leon@...nel.org>,
Christian Benvenuti <benve@...co.com>,
Nelson Escobar <neescoba@...co.com>,
Bernard Metzler <bmt@...ich.ibm.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Ian Rogers <irogers@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Bjorn Topel <bjorn@...nel.org>,
Magnus Karlsson <magnus.karlsson@...el.com>,
Maciej Fijalkowski <maciej.fijalkowski@...el.com>,
Jonathan Lemon <jonathan.lemon@...il.com>,
"David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Christian Brauner <brauner@...nel.org>,
Richard Cochran <richardcochran@...il.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Jesper Dangaard Brouer <hawk@...nel.org>,
John Fastabend <john.fastabend@...il.com>,
linux-fsdevel@...r.kernel.org, linux-perf-users@...r.kernel.org,
netdev@...r.kernel.org, bpf@...r.kernel.org,
Oleg Nesterov <oleg@...hat.com>,
Jason Gunthorpe <jgg@...dia.com>
Subject: Re: [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.
Powered by blists - more mailing lists