[RFC][CFT] splice_read reworked
CAI Qian
caiqian at redhat.com
Fri Sep 30 08:32:53 CDT 2016
----- Original Message -----
> From: "Al Viro" <viro at ZenIV.linux.org.uk>
> To: "Linus Torvalds" <torvalds at linux-foundation.org>
> Cc: "Dave Chinner" <david at fromorbit.com>, "CAI Qian" <caiqian at redhat.com>, "linux-xfs" <linux-xfs at vger.kernel.org>,
> xfs at oss.sgi.com, "Jens Axboe" <axboe at kernel.dk>, "Nick Piggin" <npiggin at gmail.com>, linux-fsdevel at vger.kernel.org
> 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 <caiqian at redhat.com>
More information about the xfs
mailing list