From a83bb15fcd0c375a18efefcd11e356e1bb96c704 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Thu, 18 Dec 2025 13:21:45 -0500 Subject: [PATCH] Reduce minimal scrub/resilver times With higher throughput and lower latency of modern devices ZFS can happily live with pretty short (fractions of a second) TXGs. But the two decade old multi-second minimal time limits can almost stop payload writes by extending TXGs beyond dirty data limits of ARC ability to amortize it. Reviewed-by: Brian Behlendorf Signed-off-by: Alexander Motin Closes #18060 --- man/man4/zfs.4 | 4 ++-- module/zfs/dsl_scan.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/man/man4/zfs.4 b/man/man4/zfs.4 index 50803101f..a2faec4e1 100644 --- a/man/man4/zfs.4 +++ b/man/man4/zfs.4 @@ -2116,7 +2116,7 @@ even if the .Sy resilver_defer feature is enabled. . -.It Sy zfs_resilver_min_time_ms Ns = Ns Sy 3000 Ns ms Po 3 s Pc Pq uint +.It Sy zfs_resilver_min_time_ms Ns = Ns Sy 1500 Ns ms Pq uint Resilvers are processed by the sync thread. While resilvering, it will spend at least this much time working on a resilver between TXG flushes. @@ -2133,7 +2133,7 @@ in order to verify the checksums of all blocks which have been copied during the expansion. This is enabled by default and strongly recommended. . -.It Sy zfs_scrub_min_time_ms Ns = Ns Sy 1000 Ns ms Po 1 s Pc Pq uint +.It Sy zfs_scrub_min_time_ms Ns = Ns Sy 750 Ns ms Pq uint Scrubs are processed by the sync thread. While scrubbing, it will spend at least this much time working on a scrub between TXG flushes. diff --git a/module/zfs/dsl_scan.c b/module/zfs/dsl_scan.c index 4a9e831dc..98bdf4771 100644 --- a/module/zfs/dsl_scan.c +++ b/module/zfs/dsl_scan.c @@ -189,7 +189,7 @@ static uint_t zfs_scan_mem_lim_fact = 20; static uint_t zfs_scan_mem_lim_soft_fact = 20; /* minimum milliseconds to scrub per txg */ -static uint_t zfs_scrub_min_time_ms = 1000; +static uint_t zfs_scrub_min_time_ms = 750; /* minimum milliseconds to obsolete per txg */ static uint_t zfs_obsolete_min_time_ms = 500; @@ -198,7 +198,7 @@ static uint_t zfs_obsolete_min_time_ms = 500; static uint_t zfs_free_min_time_ms = 500; /* minimum milliseconds to resilver per txg */ -static uint_t zfs_resilver_min_time_ms = 3000; +static uint_t zfs_resilver_min_time_ms = 1500; static uint_t zfs_scan_checkpoint_intval = 7200; /* in seconds */ int zfs_scan_suspend_progress = 0; /* set to prevent scans from progressing */