From 2bf963cc7369a31820e6fcf0c7730755ab8c8826 Mon Sep 17 00:00:00 2001 From: Ryan Moeller Date: Tue, 13 Oct 2020 12:32:34 -0400 Subject: [PATCH] Expose zfetch_max_idistance tunable FreeBSD had this value tunable before the switch to the new OpenZFS. The tunable name has changed, breaking legacy compat. Restore legacy compat for this tunable, properly expose the tunable with the new name on all platforms, and document it in zfs-module-parameters(5). While here, clean up the documentation for zfetch_max_distance a bit. Reviewed-by: Alexander Motin Reviewed-by: Brian Behlendorf Signed-off-by: Ryan Moeller Closes #11038 --- man/man5/zfs-module-parameters.5 | 15 +++++++++++++-- module/os/freebsd/zfs/sysctl_os.c | 5 +++-- module/zfs/dmu_zfetch.c | 5 ++++- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/man/man5/zfs-module-parameters.5 b/man/man5/zfs-module-parameters.5 index 47a07bd30c61..469963750a05 100644 --- a/man/man5/zfs-module-parameters.5 +++ b/man/man5/zfs-module-parameters.5 @@ -827,9 +827,20 @@ Default value: \fB1,048,576\fR. \fBzfetch_max_distance\fR (uint) .ad .RS 12n -Max bytes to prefetch per stream (default 8MB). +Max bytes to prefetch per stream. .sp -Default value: \fB8,388,608\fR. +Default value: \fB8,388,608\fR (8MB). +.RE + +.sp +.ne 2 +.na +\fBzfetch_max_idistance\fR (uint) +.ad +.RS 12n +Max bytes to prefetch indirects for per stream. +.sp +Default vaule: \fB67,108,864\fR (64MB). .RE .sp diff --git a/module/os/freebsd/zfs/sysctl_os.c b/module/os/freebsd/zfs/sysctl_os.c index c9b350a540ea..1b37ce0d7f6b 100644 --- a/module/os/freebsd/zfs/sysctl_os.c +++ b/module/os/freebsd/zfs/sysctl_os.c @@ -300,8 +300,9 @@ SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_distance, CTLFLAG_RWTUN, /* max bytes to prefetch indirects for per stream (default 64MB) */ extern uint32_t zfetch_max_idistance; -SYSCTL_UINT(_vfs_zfs_prefetch, OID_AUTO, max_idistance, CTLFLAG_RWTUN, - &zfetch_max_idistance, 0, "Max bytes to prefetch indirects for per stream"); +SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_idistance, CTLFLAG_RWTUN, + &zfetch_max_idistance, 0, + "Max bytes to prefetch indirects for per stream (LEGACY)"); /* dsl_pool.c */ diff --git a/module/zfs/dmu_zfetch.c b/module/zfs/dmu_zfetch.c index 39113cc489a0..fa43fe4fcefd 100644 --- a/module/zfs/dmu_zfetch.c +++ b/module/zfs/dmu_zfetch.c @@ -457,7 +457,10 @@ ZFS_MODULE_PARAM(zfs_prefetch, zfetch_, min_sec_reap, UINT, ZMOD_RW, "Min time before stream reclaim"); ZFS_MODULE_PARAM(zfs_prefetch, zfetch_, max_distance, UINT, ZMOD_RW, - "Max bytes to prefetch per stream (default 8MB)"); + "Max bytes to prefetch per stream"); + +ZFS_MODULE_PARAM(zfs_prefetch, zfetch_, max_idistance, UINT, ZMOD_RW, + "Max bytes to prefetch indirects for per stream"); ZFS_MODULE_PARAM(zfs_prefetch, zfetch_, array_rd_sz, ULONG, ZMOD_RW, "Number of bytes in a array_read");