From ece7ab7e7de81a9a51923d7baa7db3577de4aace Mon Sep 17 00:00:00 2001 From: Rob N Date: Fri, 7 Apr 2023 03:31:19 +1000 Subject: [PATCH] vdev: expose zfs_vdev_def_queue_depth as a module parameter It was previously available only to FreeBSD. Reviewed-by: Brian Behlendorf Reviewed-by: Tino Reichardt Reviewed-by: Alexander Motin Signed-off-by: Rob Norris Sponsored-by: Klara, Inc. Sponsored-by: Seagate Technology LLC Closes #14718 --- man/man4/zfs.4 | 5 +++++ module/os/freebsd/zfs/sysctl_os.c | 8 -------- module/zfs/vdev_queue.c | 3 +++ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/man/man4/zfs.4 b/man/man4/zfs.4 index e8e2cfec61..566caae7b4 100644 --- a/man/man4/zfs.4 +++ b/man/man4/zfs.4 @@ -1292,6 +1292,11 @@ as fuller devices will tend to be slower than empty devices. Also see .Sy zio_dva_throttle_enabled . . +.It Sy zfs_vdev_def_queue_depth Ns = Ns Sy 32 Pq uint +Default queue depth for each vdev IO allocator. +Higher values allow for better coalescing of sequential writes before sending +them to the disk, but can increase transaction commit times. +. .It Sy zfs_vdev_failfast_mask Ns = Ns Sy 1 Pq uint Defines if the driver should retire on a given error type. The following options may be bitwise-ored together: diff --git a/module/os/freebsd/zfs/sysctl_os.c b/module/os/freebsd/zfs/sysctl_os.c index eccb91deff..cc616f33db 100644 --- a/module/os/freebsd/zfs/sysctl_os.c +++ b/module/os/freebsd/zfs/sysctl_os.c @@ -887,14 +887,6 @@ SYSCTL_UINT(_vfs_zfs, OID_AUTO, top_maxinflight, " (LEGACY)"); /* END CSTYLED */ -extern uint_t zfs_vdev_def_queue_depth; - -/* BEGIN CSTYLED */ -SYSCTL_UINT(_vfs_zfs_vdev, OID_AUTO, def_queue_depth, - CTLFLAG_RWTUN, &zfs_vdev_def_queue_depth, 0, - "Default queue depth for each allocator"); -/* END CSTYLED */ - /* zio.c */ /* BEGIN CSTYLED */ diff --git a/module/zfs/vdev_queue.c b/module/zfs/vdev_queue.c index ec55674393..1a75d68abd 100644 --- a/module/zfs/vdev_queue.c +++ b/module/zfs/vdev_queue.c @@ -1119,3 +1119,6 @@ ZFS_MODULE_PARAM(zfs_vdev, zfs_vdev_, nia_delay, UINT, ZMOD_RW, ZFS_MODULE_PARAM(zfs_vdev, zfs_vdev_, queue_depth_pct, UINT, ZMOD_RW, "Queue depth percentage for each top-level vdev"); + +ZFS_MODULE_PARAM(zfs_vdev, zfs_vdev_, def_queue_depth, UINT, ZMOD_RW, + "Default queue depth for each allocator");