From 535d3eafe671c214d876b1687dca63803862d3b8 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Tue, 5 Dec 2023 15:17:04 -0500 Subject: [PATCH 1/2] ZIL: Remove 128K into 2x68K LWB split optimization To improve 128KB block write performance in case of multiple VDEVs ZIL used to spit those writes into two 64KB ones. Unfortunately it was found to cause LWB buffer overflow, trying to write maximum- sizes 128KB TX_CLONE_RANGE record with 1022 block pointers into 68KB buffer, since unlike TX_WRITE ZIL code can't split it. This is a minimally-invasive temporary block cloning fix until the following more invasive prediction code refactoring. Signed-off-by: Alexander Motin Sponsored by: iXsystems, Inc. --- module/zfs/zil.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/module/zfs/zil.c b/module/zfs/zil.c index 1ba3c01111c4..4a4c204bccf3 100644 --- a/module/zfs/zil.c +++ b/module/zfs/zil.c @@ -1728,8 +1728,6 @@ static const struct { { 8192 + 4096, 8192 + 4096 }, /* database */ { 32768 + 4096, 32768 + 4096 }, /* NFS writes */ { 65536 + 4096, 65536 + 4096 }, /* 64KB writes */ - { 131072, 131072 }, /* < 128KB writes */ - { 131072 +4096, 65536 + 4096 }, /* 128KB writes */ { UINT64_MAX, SPA_OLD_MAXBLOCKSIZE}, /* > 128KB writes */ }; From bb180f8e37fdcf376a2747ce067e0a4c6e1e0a0e Mon Sep 17 00:00:00 2001 From: Ameer Hamza Date: Wed, 6 Dec 2023 22:42:49 +0500 Subject: [PATCH 2/2] Revert "zfs-2.2.1: Disable block cloning by default" This reverts commit 479dca51c66a731e637bd2d4f9bba01a05f9ac9f. Signed-off-by: Ameer Hamza --- module/os/freebsd/zfs/zfs_vfsops.c | 2 +- module/os/linux/zfs/zpl_file_range.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/os/freebsd/zfs/zfs_vfsops.c b/module/os/freebsd/zfs/zfs_vfsops.c index 23b8da184535..f2d5391037c4 100644 --- a/module/os/freebsd/zfs/zfs_vfsops.c +++ b/module/os/freebsd/zfs/zfs_vfsops.c @@ -89,7 +89,7 @@ int zfs_debug_level; SYSCTL_INT(_vfs_zfs, OID_AUTO, debug, CTLFLAG_RWTUN, &zfs_debug_level, 0, "Debug level"); -int zfs_bclone_enabled = 0; +int zfs_bclone_enabled = 1; SYSCTL_INT(_vfs_zfs, OID_AUTO, bclone_enabled, CTLFLAG_RWTUN, &zfs_bclone_enabled, 0, "Enable block cloning"); diff --git a/module/os/linux/zfs/zpl_file_range.c b/module/os/linux/zfs/zpl_file_range.c index 139c51cf46df..73476ff40ebf 100644 --- a/module/os/linux/zfs/zpl_file_range.c +++ b/module/os/linux/zfs/zpl_file_range.c @@ -31,7 +31,7 @@ #include #include -int zfs_bclone_enabled = 0; +int zfs_bclone_enabled = 1; /* * Clone part of a file via block cloning.