From 4f93dd7f030356a600e9562ed1eaa19a289a4f5e Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Wed, 28 Sep 2022 02:38:03 +0200 Subject: [PATCH] Bring per_txg_dirty_frees_percent back to 30 The current value causes significant artificial slowdown during mass parallel file removal, which can be observed both on FreeBSD and Linux when running real workloads. Sample results from Linux doing make -j 96 clean after an allyesconfig modules build: before: 4.14s user 6.79s system 48% cpu 22.631 total after: 4.17s user 6.44s system 153% cpu 6.927 total FreeBSD results in the ticket. Reviewed-by: Alexander Motin Reviewed-by: Brian Behlendorf Reviewed-by: Richard Yao Reviewed-by: George Melikov Signed-off-by: Mateusz Guzik Closes #13932 Closes #13938 --- man/man4/zfs.4 | 2 +- module/zfs/dmu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/man/man4/zfs.4 b/man/man4/zfs.4 index b6fd64a58446..75b59b72f0a2 100644 --- a/man/man4/zfs.4 +++ b/man/man4/zfs.4 @@ -1626,7 +1626,7 @@ prefetched during a pool traversal, like .Nm zfs Cm send or other data crawling operations. . -.It Sy zfs_per_txg_dirty_frees_percent Ns = Ns Sy 5 Ns % Pq ulong +.It Sy zfs_per_txg_dirty_frees_percent Ns = Ns Sy 30 Ns % Pq ulong Control percentage of dirtied indirect blocks from frees allowed into one TXG. After this threshold is crossed, additional frees will wait until the next TXG. .Sy 0 No disables this throttle. diff --git a/module/zfs/dmu.c b/module/zfs/dmu.c index b29d82fd793e..3c7e0099fc11 100644 --- a/module/zfs/dmu.c +++ b/module/zfs/dmu.c @@ -70,7 +70,7 @@ int zfs_nopwrite_enabled = 1; * will wait until the next TXG. * A value of zero will disable this throttle. */ -unsigned long zfs_per_txg_dirty_frees_percent = 5; +static unsigned long zfs_per_txg_dirty_frees_percent = 30; /* * Enable/disable forcing txg sync when dirty in dmu_offset_next.