[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230420223657.GV3390869@ZenIV>
Date: Thu, 20 Apr 2023 23:36:57 +0100
From: Al Viro <viro@...iv.linux.org.uk>
To: David Howells <dhowells@...hat.com>
Cc: Jens Axboe <axboe@...nel.dk>,
Christoph Hellwig <hch@...radead.org>,
Matthew Wilcox <willy@...radead.org>, Jan Kara <jack@...e.cz>,
Jeff Layton <jlayton@...nel.org>,
David Hildenbrand <david@...hat.com>,
Jason Gunthorpe <jgg@...dia.com>,
Logan Gunthorpe <logang@...tatee.com>,
Hillf Danton <hdanton@...a.com>,
Christian Brauner <brauner@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
linux-fsdevel@...r.kernel.org, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Christoph Hellwig <hch@....de>,
John Hubbard <jhubbard@...dia.com>
Subject: Re: [PATCH v18 09/15] iov_iter: Kill ITER_PIPE
On Thu, Apr 20, 2023 at 11:22:31PM +0100, Al Viro wrote:
> On Tue, Mar 14, 2023 at 10:07:51PM +0000, David Howells wrote:
> > The ITER_PIPE-type iterator was only used for generic_file_splice_read(),
> > but that has now been switched to either pull pages directly from the
> > pagecache for buffered file splice-reads or to use ITER_BVEC instead for
> > O_DIRECT file splice-reads. This leaves ITER_PIPE unused - so remove it.
>
> Wonderful, except that now you've got duplicates of ->read_iter() for
> everyone who wants zero-copy on ->splice_read() ;-/
>
> I understand the attraction of arbitrary seeks on those suckers; ITER_PIPE
> is a massive headache in that respect. But I really don't like what your
> approach trades it for.
>
> And you are nowhere near done - consider e.g. NFS. Mainline has it
> feed ITER_PIPE to nfs_file_read(), which does call generic_file_read_iter() -
> after
> result = nfs_revalidate_mapping(inode, iocb->ki_filp->f_mapping);
>
> Sure, you can add nfs_file_splice_read() that would do what nfs_file_read()
> does, calling filemap_spice_read() instead of generic_file_read_iter().
>
> Repeat the same for ocfs2 (locking of its own). And orangefs. And
> XFS (locking, again). And your own AFS, while we are at it. Et sodding
> cetera - *everything* that uses generic_file_splice_read() with
> ->read_iter other than generic_file_read_iter() needs review and,
> quite likely, a ->splice_read() instance of its own.
Don't get me wrong - I'd love to kill ITER_PIPE off; it's just that tons
of ->splice_read() duplicating the corresponding ->read_iter() up to the
point where it would call generic_file_read_iter(), modulo ignoring
O_DIRECT case and then calling filemap_splice_read() instead... Painful
and asking for trouble down the road.
Powered by blists - more mailing lists