From c0f62d4fdf80299265bb16c26dbabec39f13c528 Mon Sep 17 00:00:00 2001 From: Christos Longros <98426896+chrislongros@users.noreply.github.com> Date: Thu, 18 Jun 2026 22:42:39 +0200 Subject: [PATCH] spa: make ccw_retry_interval tunable on Linux (#18681) zfs_ccw_retry_interval sets the time interval after which a retry of a failed write of the configuration cache file is attempted. It was only exposed on FreeBSD. Make it Linux tunable with ZFS_MODULE_PARAM and document it in zfs.4. Signed-off-by: Christos Longros Reviewed-by: Alexander Motin Signed-off-by: Richard Yao --- man/man4/zfs.4 | 4 ++++ module/os/freebsd/zfs/sysctl_os.c | 9 --------- module/zfs/spa.c | 4 ++++ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/man/man4/zfs.4 b/man/man4/zfs.4 index 9967d9af7399..bb896ac9dc6a 100644 --- a/man/man4/zfs.4 +++ b/man/man4/zfs.4 @@ -1090,6 +1090,10 @@ and uses pages, unlike the Linux-specific .Sy zfs_arc_sys_free which is measured in bytes. . +.It Sy zfs_ccw_retry_interval Ns = Ns Sy 300 Ns s Pq int +Interval, in seconds, at which a failed write of the configuration cache file +is retried. +. .It Sy zfs_checksum_events_per_second Ns = Ns Sy 20 Ns /s Pq uint Rate limit checksum events to this many per second. Note that this should not be set below the ZED thresholds diff --git a/module/os/freebsd/zfs/sysctl_os.c b/module/os/freebsd/zfs/sysctl_os.c index 32f2db739ce1..e1b19290d34f 100644 --- a/module/os/freebsd/zfs/sysctl_os.c +++ b/module/os/freebsd/zfs/sysctl_os.c @@ -306,15 +306,6 @@ param_set_multihost_interval(SYSCTL_HANDLER_ARGS) return (0); } -/* spa.c */ - -extern int zfs_ccw_retry_interval; - -SYSCTL_INT(_vfs_zfs, OID_AUTO, ccw_retry_interval, - CTLFLAG_RWTUN, &zfs_ccw_retry_interval, 0, - "Configuration cache file write, retry after failure, interval" - " (seconds)"); - /* spa_misc.c */ extern int zfs_flags; diff --git a/module/zfs/spa.c b/module/zfs/spa.c index c6ae91b8d9e9..810589b42f45 100644 --- a/module/zfs/spa.c +++ b/module/zfs/spa.c @@ -11866,3 +11866,7 @@ ZFS_MODULE_VIRTUAL_PARAM_CALL(zfs_zio, zio_, taskq_free, ZFS_MODULE_PARAM(zfs_zio, zio_, taskq_write_tpq, UINT, ZMOD_RW, "Number of CPUs per write issue taskq"); + +ZFS_MODULE_PARAM(zfs, zfs_, ccw_retry_interval, INT, ZMOD_RW, + "Configuration cache file write, retry after failure, interval " + "(seconds)");