[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZEFa3YO+0/HZ3Hz/@nvidia.com>
Date: Thu, 20 Apr 2023 12:31:41 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: Lorenzo Stoakes <lstoakes@...il.com>
Cc: Pavel Begunkov <asml.silence@...il.com>,
Matthew Wilcox <willy@...radead.org>,
Jens Axboe <axboe@...nel.dk>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
David Hildenbrand <david@...hat.com>, io-uring@...r.kernel.org
Subject: Re: [PATCH v4 4/6] io_uring: rsrc: avoid use of vmas parameter in
pin_user_pages()
On Thu, Apr 20, 2023 at 03:19:01PM +0100, Lorenzo Stoakes wrote:
> So I guess the question is, do you feel the requirement for vm_file being
> the same should apply across _any_ GUP operation over a range or is it
> io_uring-specific?
No need at all anywhere.
GUP's API contract is you get a jumble of pages with certain
properties. Ie normal GUP gives you a jumble of CPU cache coherent
struct pages.
The job of the GUP caller is to process this jumble.
There is no architectural reason to restrict it beyond that, and
io_uring has no functional need either.
The caller of GUP is, by design, not supposed to know about files, or
VMAs, or other MM details. GUP's purpose is to abstract that.
I would not object if io_uring demanded that all struct pages be in a
certain way, like all are P2P or something. But that is a *struct
page* based test, not a VMA test.
Checking VMAs is basically io_uring saying it knows better than GUP
and better than the MM on how this abstraction should work.
Jason
Powered by blists - more mailing lists