mirror_zfs/lib/libzfs
Ryan Moeller 6fe3498ca3
Import vdev ashift optimization from FreeBSD
Many modern devices use physical allocation units that are much
larger than the minimum logical allocation size accessible by
external commands. Two prevalent examples of this are 512e disk
drives (512b logical sector, 4K physical sector) and flash devices
(512b logical sector, 4K or larger allocation block size, and 128k
or larger erase block size). Operations that modify less than the
physical sector size result in a costly read-modify-write or garbage
collection sequence on these devices.

Simply exporting the true physical sector of the device to ZFS would
yield optimal performance, but has two serious drawbacks:

 1. Existing pools created with devices that have different logical
    and physical block sizes, but were configured to use the logical
    block size (e.g. because the OS version used for pool construction
    reported the logical block size instead of the physical block
    size) will suddenly find that the vdev allocation size has
    increased. This can be easily tolerated for active members of
    the array, but ZFS would prevent replacement of a vdev with
    another identical device because it now appears that the smaller
    allocation size required by the pool is not supported by the new
    device.

 2. The device's physical block size may be too large to be supported
    by ZFS. The optimal allocation size for the vdev may be quite
    large. For example, a RAID controller may export a vdev that
    requires read-modify-write cycles unless accessed using 64k
    aligned/sized requests. ZFS currently has an 8k minimum block
    size limit.

Reporting both the logical and physical allocation sizes for vdevs
solves these problems. A device may be used so long as the logical
block size is compatible with the configuration. By comparing the
logical and physical block sizes, new configurations can be optimized
and administrators can be notified of any existing pools that are
sub-optimal.

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Matthew Macy <mmacy@freebsd.org>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Closes #10619
2020-08-21 12:53:17 -07:00
..
os FreeBSD: Fix module autoloading when built in base 2020-08-11 13:49:50 -07:00
.gitignore Clean up lib dependencies 2020-07-10 14:26:00 -07:00
libzfs_changelist.c Remove dependency on sharetab file and refactor sharing logic 2020-07-13 09:19:18 -07:00
libzfs_config.c Use zfs_ioctl with zfs_cmd_t in libzfs 2019-10-23 17:29:43 -07:00
libzfs_crypto.c Fix typos 2020-06-09 21:24:09 -07:00
libzfs_dataset.c Remove dependency on sharetab file and refactor sharing logic 2020-07-13 09:19:18 -07:00
libzfs_diff.c Don't open zfs control device exclusively 2020-02-28 14:54:14 -08:00
libzfs_import.c Persistent L2ARC 2020-04-10 10:33:35 -07:00
libzfs_iter.c Mark functions as static 2020-06-18 12:20:38 -07:00
libzfs_mount.c Remove dependency on sharetab file and refactor sharing logic 2020-07-13 09:19:18 -07:00
libzfs_pool.c Remove unused zpool_is_bootable 2020-08-18 09:30:12 -07:00
libzfs_sendrecv.c libzfs: Make zfs_cmd_t initialization consistent, use zfs_ioctl 2020-07-09 17:47:12 -07:00
libzfs_status.c Import vdev ashift optimization from FreeBSD 2020-08-21 12:53:17 -07:00
libzfs_util.c Change the error handling for invalid property values 2020-08-01 08:41:31 -07:00
libzfs.pc.in Clean up lib dependencies 2020-07-10 14:26:00 -07:00
Makefile.am Disable -Wl,-z,defs for ASAN builds 2020-07-14 12:17:44 -07:00
THIRDPARTYLICENSE.openssl Fix typos in lib/ 2019-09-02 17:53:27 -07:00
THIRDPARTYLICENSE.openssl.descrip Encryption patch follow-up 2017-10-11 16:54:48 -04:00