FreeBSD src
Go to file
Etienne Dechamps a5c20e2a0a Don't ashift-align vdev read requests.
Currently, the size of read and write requests on vdevs is aligned
according to the vdev's ashift, allocating a new ZIO buffer and padding
if need be.

This makes sense for write requests to prevent read/modify/write if the
write happens to be smaller than the device's internal block size.

For reads however, the rationale is less clear. It seems that the
original code aligns reads because, on Solaris, device drivers will
outright refuse unaligned requests.

We don't have that issue on Linux. Indeed, Linux block devices are able
to accept requests of any size, and take care of alignment issues
themselves.

As a result, there's no point in enforcing alignment for read requests
on Linux. This is a nice optimization opportunity for two reasons:
- We remove a memory allocation in a heavily-used code path;
- The request gets aligned in the lowest layer possible, which shrinks
  the path that the additional, useless padding data has to travel.
  For example, when using 4k-sector drives that lie about their sector
  size, using 512b read requests instead of 4k means that there will
  be less data traveling down the ATA/SCSI interface, even though the
  drive actually reads 4k from the platter.

The only exception is raidz, because raidz needs to read the whole
allocated block for parity.

This patch removes alignment enforcement for read requests, except on
raidz. Note that we also remove an assertion that checks that we're
aligning a top-level vdev I/O, because that's not the case anymore for
repair writes that results from failed reads.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1022
2012-10-12 12:01:56 -07:00
cmd Realpath arg 2 must be a minimum of PATH_MAX 2012-10-04 13:19:10 -07:00
config Modify vdev_elevator_switch() to use elevator_change() 2012-10-03 13:31:44 -07:00
dracut Remove autotools products 2012-08-27 11:47:44 -07:00
etc Remove autotools products 2012-08-27 11:47:44 -07:00
include Fix zfs_txg_timeout module parameter 2012-10-11 15:07:09 -07:00
lib Illumos #3100: zvol rename fails with EBUSY when dirty. 2012-10-03 13:59:02 -07:00
man zfs.8: add missing info about dedup, mlslabel 2012-10-09 09:54:16 -07:00
module Don't ashift-align vdev read requests. 2012-10-12 12:01:56 -07:00
patches Adding grub2 mkconfig support patch 2012-07-30 16:17:23 -07:00
scripts Force 4K blocksize when testing ext2 on zvol. 2012-10-03 10:52:51 -07:00
udev Remove autotools products 2012-08-27 11:47:44 -07:00
.gitignore Remove autotools products 2012-09-11 10:15:13 -07:00
AUTHORS Add "ashift" property to zpool create 2011-06-17 16:35:49 -07:00
autogen.sh Remove autotools products 2012-08-27 11:47:44 -07:00
ChangeLog Add build system 2010-08-31 13:41:27 -07:00
configure.ac Add zstreamdump(8) command to examine ZFS send streams. 2012-09-02 14:54:27 -07:00
copy-builtin Consistent menuconfig name 2012-08-26 13:49:37 -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
dkms.conf.in Support building a zfs-modules-dkms sub package 2012-08-08 15:21:01 -07:00
dkms.postinst Support building a zfs-modules-dkms sub package 2012-08-08 15:21:01 -07:00
Makefile.am Add copy-builtin to EXTRA_DIST 2012-08-23 09:50:00 -07:00
META zfs-0.6.0-rc11 2012-09-18 11:30:24 -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-modules.spec.in Cleanly remove zfs-modules-devel headers 2012-08-13 16:35:26 -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 Fix man page installation path 2012-08-10 15:32:30 -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