Skip to content

Commit 602fecc

Browse files
amotintonyhutter
authored andcommitted
Prefer embedded blocks to dedup
Since embedded blocks introduction 11 years ago, their writing was blocked if dedup is enabled. After searching through the modern code I see no reason for this restriction to exist. Same time embedded blocks are dramatically cheaper. Even regular write of so small blocks would likely be cheaper than deduplication, even if the last is successful, not mentioning otherwise. Reviewed-by: Allan Jude <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Alexander Motin <[email protected]> Sponsored by: iXsystems, Inc. Closes #17113 (cherry picked from commit 09f4dd0)
1 parent 588fa16 commit 602fecc

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

module/zfs/zio.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2006,8 +2006,7 @@ zio_write_compress(zio_t *zio)
20062006
compress = ZIO_COMPRESS_OFF;
20072007
if (cabd != NULL)
20082008
abd_free(cabd);
2009-
} else if (!zp->zp_dedup && !zp->zp_encrypt &&
2010-
psize <= BPE_PAYLOAD_SIZE &&
2009+
} else if (psize <= BPE_PAYLOAD_SIZE && !zp->zp_encrypt &&
20112010
zp->zp_level == 0 && !DMU_OT_HAS_FILL(zp->zp_type) &&
20122011
spa_feature_is_enabled(spa, SPA_FEATURE_EMBEDDED_DATA)) {
20132012
void *cbuf = abd_borrow_buf_copy(cabd, lsize);

tests/zfs-tests/tests/functional/cli_root/zpool_prefetch/zpool_prefetch_001_pos.ksh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ log_must zpool prefetch -t ddt $TESTPOOL
7676
# to generate a reasonable size DDT for testing purposes.
7777

7878
DATASET=$TESTPOOL/ddt
79-
log_must zfs create -o dedup=on $DATASET
79+
log_must zfs create -o compression=off -o dedup=on $DATASET
8080
MNTPOINT=$(get_prop mountpoint $TESTPOOL/ddt)
8181

8282
log_note "Generating dataset ..."

tests/zfs-tests/tests/functional/dedup/dedup_quota.ksh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function do_setup
8080
log_must truncate -s 5G $VDEV_GENERAL
8181
# Use 'xattr=sa' to prevent selinux xattrs influencing our accounting
8282
log_must zpool create -o ashift=12 -f -O xattr=sa -m $MOUNTDIR $POOL $VDEV_GENERAL
83-
log_must zfs set dedup=on $POOL
83+
log_must zfs set compression=off dedup=on $POOL
8484
log_must set_tunable32 TXG_TIMEOUT 600
8585
}
8686

0 commit comments

Comments
 (0)