mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 05:58:57 +00:00
Increase default volblocksize from 8KB to 16KB
Many things has changed since previous default was set many years ago. Nowadays 8KB does not allow adequate compression or even decent space efficiency on many of pools due to 4KB disk physical block rounding, especially on RAIDZ and DRAID. It effectively limits write throughput to only 2-3GB/s (250-350K blocks/s) due to sync thread, allocation, vdev queue and other block rate bottlenecks. It keeps L2ARC expensive despite many optimizations and dedup just unrealistic. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: George Melikov <mail@gmelikov.ru> Signed-off-by: Alexander Motin <mav@FreeBSD.org> Closes #12406
This commit is contained in:
parent
bb7ad5d326
commit
72f0521aba
@ -1225,7 +1225,7 @@ typedef struct ddt_histogram {
|
||||
#define ZVOL_DEV_NAME "zd"
|
||||
|
||||
#define ZVOL_PROP_NAME "name"
|
||||
#define ZVOL_DEFAULT_BLOCKSIZE 8192
|
||||
#define ZVOL_DEFAULT_BLOCKSIZE 16384
|
||||
|
||||
typedef enum {
|
||||
VDEV_INITIALIZE_NONE,
|
||||
|
@ -527,7 +527,7 @@ cannot be changed once the volume has been written, so it should be set at
|
||||
volume creation time.
|
||||
The default
|
||||
.Sy blocksize
|
||||
for volumes is 8 Kbytes.
|
||||
for volumes is 16 Kbytes.
|
||||
Any power of 2 from 512 bytes to 128 Kbytes is valid.
|
||||
.Pp
|
||||
This property can also be referred to by its shortened column name,
|
||||
|
@ -62,4 +62,4 @@ set -A size "8k" "8K" "35K" "1m" "1M" "1mb" "1mB" "1Mb" "1MB" "1g" "1G" \
|
||||
# explicitly check that its size has been rounded up to the nearest multiple
|
||||
# The volume with the exact size must exist in the "size" array above
|
||||
set -A explicit_size_check "35K"
|
||||
set -A expected_rounded_size "40960"
|
||||
set -A expected_rounded_size "49152"
|
||||
|
@ -45,14 +45,14 @@ log_assert "nopwrite works on volumes"
|
||||
|
||||
log_must zfs set compress=on $origin
|
||||
log_must zfs set checksum=sha256 $origin
|
||||
dd if=/dev/urandom of=$vol bs=8192 count=4096 conv=notrunc >/dev/null \
|
||||
dd if=/dev/urandom of=$vol bs=16384 count=2048 conv=notrunc >/dev/null \
|
||||
2>&1 || log_fail "dd into $origin failed."
|
||||
zfs snapshot $origin@a || log_fail "zfs snap failed"
|
||||
log_must zfs clone $origin@a $clone
|
||||
log_must zfs set compress=on $clone
|
||||
log_must zfs set checksum=sha256 $clone
|
||||
block_device_wait
|
||||
dd if=$vol of=$volclone bs=8192 count=4096 conv=notrunc >/dev/null 2>&1 || \
|
||||
dd if=$vol of=$volclone bs=16384 count=2048 conv=notrunc >/dev/null 2>&1 || \
|
||||
log_fail "dd into $clone failed."
|
||||
log_must verify_nopwrite $origin $origin@a $clone
|
||||
|
||||
|
@ -108,7 +108,7 @@ function create_multiple_fs # num_fs base_fs_name base_mnt_name
|
||||
|
||||
#
|
||||
# This function compute the largest volume size which is multiple of volume
|
||||
# block size (default 8K) and not greater than the largest expected volsize.
|
||||
# block size (default 16K) and not greater than the largest expected volsize.
|
||||
#
|
||||
# $1 The largest expected volume size.
|
||||
# $2 The volume block size
|
||||
@ -116,7 +116,7 @@ function create_multiple_fs # num_fs base_fs_name base_mnt_name
|
||||
function floor_volsize #<largest_volsize> [volblksize]
|
||||
{
|
||||
typeset largest_volsize=$1
|
||||
typeset volblksize=${2:-8192}
|
||||
typeset volblksize=${2:-16384}
|
||||
|
||||
if ((largest_volsize < volblksize)); then
|
||||
log_fail "The largest_volsize must be greater than volblksize."
|
||||
@ -157,7 +157,7 @@ function volsize_to_reservation
|
||||
typeset volblocksize=$(get_prop volblocksize $vol)
|
||||
else
|
||||
typeset ncopies=1
|
||||
typeset volblocksize=8192
|
||||
typeset volblocksize=16384
|
||||
fi
|
||||
typeset nblocks=$((volsize / volblocksize))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user