Go to file
Etienne Dechamps 7c0e570888 Limit the number of blocks to discard at once.
The number of blocks that can be discarded in one BLKDISCARD ioctl on a
zvol is currently unlimited. Some applications, such as mkfs, discard
the whole volume at once and they use the maximum possible discard size
to do that. As a result, several gigabytes discard requests are not
uncommon.

Unfortunately, if a large amount of data is allocated in the zvol, ZFS
can be quite slow to process discard requests. This is especially true
if the volblocksize is low (e.g. the 8K default). As a result, very
large discard requests can take a very long time (seconds to minutes
under heavy load) to complete. This can cause a number of problems, most
notably if the zvol is accessed remotely (e.g. via iSCSI), in which case
the client has a high probability of timing out on the request.

This patch solves the issue by adding a new tunable module parameter:
zvol_max_discard_blocks. This indicates the maximum possible range, in
zvol blocks, of one discard operation. It is set by default to 16384
blocks, which appears to be a good tradeoff. Using the default
volblocksize of 8K this is equivalent to 128 MB. When using the maximum
volblocksize of 128K this is equivalent to 2 GB.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #858
2012-07-31 09:46:09 -07:00
cmd Illumos #1644, #1645, #1646, #1647, #1708 2012-07-31 09:25:30 -07:00
config When checking for symbol exports, try compiling. 2012-07-26 13:42:57 -07:00
dracut Linux 3.5 compat, end_writeback() changed to clear_inode() 2012-07-23 12:29:36 -07:00
etc Linux 3.5 compat, end_writeback() changed to clear_inode() 2012-07-23 12:29:36 -07:00
include Illumos #1644, #1645, #1646, #1647, #1708 2012-07-31 09:25:30 -07:00
lib Illumos #1644, #1645, #1646, #1647, #1708 2012-07-31 09:25:30 -07:00
man Illumos #1644, #1645, #1646, #1647, #1708 2012-07-31 09:25:30 -07:00
module Limit the number of blocks to discard at once. 2012-07-31 09:46:09 -07:00
patches Adding grub2 mkconfig support patch 2012-07-30 16:17:23 -07:00
scripts Linux 3.5 compat, end_writeback() changed to clear_inode() 2012-07-23 12:29:36 -07:00
udev Linux 3.5 compat, end_writeback() changed to clear_inode() 2012-07-23 12:29:36 -07:00
.gitignore Ignore unsigned module build products 2010-03-09 14:14:09 -08:00
AUTHORS Add "ashift" property to zpool create 2011-06-17 16:35:49 -07:00
autogen.sh Make autogen.sh executable 2011-07-26 10:15:35 -07:00
ChangeLog Add build system 2010-08-31 13:41:27 -07:00
configure When checking for symbol exports, try compiling. 2012-07-26 13:42:57 -07:00
configure.ac Move zfs.release generation to configure step 2012-07-12 12:22:51 -07:00
copy-builtin Add script for builtin module building. 2012-07-26 13:45:09 -07:00
COPYING Relocate COPYING+COPYRIGHT, remove README cruft 2008-12-01 15:34:53 -08:00
COPYRIGHT Update COPYRIGHT to reference zpios CDDL exceptions. 2010-05-18 14:25:28 -07:00
DISCLAIMER Update COPYRIGHT and DISCLAIMER. 2010-05-18 10:32:23 -07:00
Makefile.am Move zfs.release generation to configure step 2012-07-12 12:22:51 -07:00
Makefile.in Don't build packages that haven't been selected. 2012-07-26 13:39:37 -07:00
META ZFS 0.6.0-rc9 2012-06-14 11:46:40 -07:00
OPENSOLARIS.LICENSE Add CDDL license file 2008-12-01 14:49:34 -08:00
PKGBUILD-zfs-modules.in Add make rule for building Arch Linux packages 2011-12-14 19:14:23 -08:00
PKGBUILD-zfs.in Add make rule for building Arch Linux packages 2011-12-14 19:14:23 -08:00
README.markdown Add script for builtin module building. 2012-07-26 13:45:09 -07:00
zfs_config.h.in Linux 3.5 compat, end_writeback() changed to clear_inode() 2012-07-23 12:29:36 -07:00
zfs-modules.spec.in Remove Chaos 4.x RPM support 2012-07-02 15:16:05 -07:00
zfs-script-config.sh.in Unconditionally load core kernel modules 2010-11-11 11:38:25 -08:00
ZFS.RELEASE Update to onnv_147 2010-08-26 14:24:34 -07:00
zfs.release.in Move zfs.release generation to configure step 2012-07-12 12:22:51 -07:00
zfs.spec.in Mark zdev.conf as a config file 2012-06-13 13:02:43 -07:00

Native ZFS for Linux! ZFS is an advanced file system and volume manager which was originally developed for Solaris. It has been successfully ported to FreeBSD and now there is a functional Linux ZFS kernel port too. The port currently includes a fully functional and stable SPA, DMU, and ZVOL with a ZFS Posix Layer (ZPL) on the way!

$ ./configure
$ make pkg

To copy the kernel code inside your kernel source tree for builtin compilation:

$ ./configure --enable-linux-builtin --with-linux=/usr/src/linux-...
$ ./copy-builtin /usr/src/linux-...

Full documentation for building, configuring, and using ZFS can be found at: http://zfsonlinux.org