]> granicus.if.org Git - zfs/commit
Increase Linux pipe buffer size on 'zfs receive'
authorRichard Yao <richard.yao@clusterhq.com>
Wed, 11 Mar 2015 18:24:46 +0000 (14:24 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 20 Mar 2015 17:03:34 +0000 (10:03 -0700)
commit5c3f61eb498e8124858b1369096bf64b86a938e7
tree44b88b4b2549d8e4fb1fd3fd39ab5cf5a00999fd
parentb1a3e93217e6e474e86345010469994c066cf875
Increase Linux pipe buffer size on 'zfs receive'

I noticed when reviewing documentation that it is possible for user
space to use fctnl(fd, F_SETPIPE_SZ, (unsigned long) size) to change
the kernel pipe buffer size on Linux to increase the pipe size up to
the value specified in /proc/sys/fs/pipe-max-size. There are users using
mbuffer to improve zfs recv performance when piping over the network, so
it seems advantageous to integrate such functionality directly into the
zfs recv tool. This avoids the addition of two buffers and two copies
(one for the buffer mbuffer adds and another for the additional pipe),
so it should be more efficient.

This could have been made configurable and/or this could have changed
the value back to the original after we were done with the file
descriptor, but I do not see a strong case for doing either, so I
went with a simple implementation.

Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #1161
lib/libzfs/libzfs_sendrecv.c