[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3515368f-d622-f7d2-5854-9503d4a19fb2@redhat.com>
Date: Tue, 17 Jan 2023 09:07:48 +0100
From: David Hildenbrand <david@...hat.com>
To: Christoph Hellwig <hch@...radead.org>,
David Howells <dhowells@...hat.com>
Cc: Al Viro <viro@...iv.linux.org.uk>,
Matthew Wilcox <willy@...radead.org>,
Jens Axboe <axboe@...nel.dk>, Jan Kara <jack@...e.cz>,
Jeff Layton <jlayton@...nel.org>,
Logan Gunthorpe <logang@...tatee.com>,
linux-fsdevel@...r.kernel.org, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH v6 03/34] iov_iter: Pass I/O direction into
iov_iter_get_pages*()
On 17.01.23 08:57, Christoph Hellwig wrote:
> On Mon, Jan 16, 2023 at 11:08:24PM +0000, David Howells wrote:
>> Define FOLL_SOURCE_BUF and FOLL_DEST_BUF to indicate to get_user_pages*()
>> and iov_iter_get_pages*() how the buffer is intended to be used in an I/O
>> operation. Don't use READ and WRITE as a read I/O writes to memory and
>> vice versa - which causes confusion.
>>
>> The direction is checked against the iterator's data_source.
>
> Why can't we use the existing FOLL_WRITE?
Agreed. What I understand, David considers that confusing when
considering the I/O side of things.
I recall that there is
DMA_BIDIRECTIONAL -> FOLL_WRITE
DMA_TO_DEVICE -> !FOLL_WRITE
DMA_FROM_DEVICE -> FOLL_WRITE
that used different defines for a different API. Such terminology would
be easier to get ... but then, again, not sure if we really need
acronyms here.
We're pinning pages and FOLL_WRITE defines how we (pinning the page) are
going to access these pages: R/O or R/W. So the read vs. write is never
from the POC of the device (DMA read will write to the page).
--
Thanks,
David / dhildenb
Powered by blists - more mailing lists