Re: [RFC][CFT] splice_read reworked
CAI Qian <[email protected]> Fri, 30 Sep 2016 09:32:53 -0400 (EDT)
| Newsgroups | gmane.comp.file-systems.xfs.general |
|---|---|
| Message-ID | <2131586457.763354.1475242373422.JavaMail.zimbra__47899.3599107072$1475242411$gmane$org@redhat.com> |
----- Original Message ----- > From: "Al Viro" <[email protected]> > To: "Linus Torvalds" <[email protected]> > Cc: "Dave Chinner" <[email protected]>, "CAI Qian" <[email protected]>, "linux-xfs" <[email protected]>, > [email protected], "Jens Axboe" <[email protected]>, "Nick Piggin" <[email protected]>, [email protected] > Sent: Friday, September 23, 2016 3:00:32 PM > Subject: [RFC][CFT] splice_read reworked > > The series is supposed to solve the locking order problems for > ->splice_read() and get rid of code duplication between the read-side > methods. > pipe_lock is lifted out of ->splice_read() instances, along with > waiting for empty space in pipe, etc. - we do that stuff in callers. > A new variant of iov_iter is introduced - it's backed by a pipe, > copy_to_iter() results in allocating pages and copying into those, > copy_page_to_iter() just sticks a reference to that page into pipe. > Running out of space in pipe yields a short read, as a fault in iovec-backed > iov_iter would have. Enough primitives are implemented for normal > ->read_iter() instances to work. > generic_file_splice_read() switched to feeding such iov_iter to > ->read_iter() instance. That turns out to be enough to kill almost all > ->splice_read() instances; the only ones _not_ using > generic_file_splice_read() > or default_file_splice_read() (== no zero-copy fallback) are > fuse_dev_splice_read(), 3 instances in kernel/{relay.c,trace/trace.c} and > sock_splice_read(). It's almost certainly possible to convert fuse one > and the same might be possible to do to socket one. relay and tracing > stuff is just plain weird; might or might not be doable. > > Something hopefully working is in > git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git #work.splice_read Tested-by: CAI Qian <[email protected]> _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs