diff --git a/man/man4/zfs.4 b/man/man4/zfs.4 index 09195b03e1a..9967d9af739 100644 --- a/man/man4/zfs.4 +++ b/man/man4/zfs.4 @@ -390,6 +390,18 @@ this is or .Em 2*1024 Pq with Sy ashift Ns = Ns Sy 12 . . +.It Sy metaslab_df_alloc_threshold Ns = Ns Sy 131072 Ns B Po 128 KiB Pc Pq u64 +Minimum size which forces the dynamic allocator to change its allocation +strategy. +Once the space map cannot satisfy an allocation of this size, it switches to a +more aggressive strategy (searching by size rather than offset). +. +.It Sy metaslab_df_free_pct Ns = Ns Sy 4 Ns % Pq uint +The minimum free space, in percent, which must be available in a space map to +continue allocations in a first-fit fashion. +Once free space drops below this level, allocations switch to a best-fit +strategy. +. .It Sy metaslab_df_use_largest_segment Ns = Ns Sy 0 Ns | Ns 1 Pq int If not searching forward (due to .Sy metaslab_df_max_search , metaslab_df_free_pct , diff --git a/module/os/freebsd/zfs/sysctl_os.c b/module/os/freebsd/zfs/sysctl_os.c index a0a721aec20..32f2db739ce 100644 --- a/module/os/freebsd/zfs/sysctl_os.c +++ b/module/os/freebsd/zfs/sysctl_os.c @@ -289,32 +289,6 @@ param_set_active_allocator(SYSCTL_HANDLER_ARGS) return (param_set_active_allocator_common(buf)); } -/* - * Minimum size which forces the dynamic allocator to change - * it's allocation strategy. Once the space map cannot satisfy - * an allocation of this size then it switches to using more - * aggressive strategy (i.e search by size rather than offset). - */ -extern uint64_t metaslab_df_alloc_threshold; - -SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, df_alloc_threshold, - CTLFLAG_RWTUN, &metaslab_df_alloc_threshold, 0, - "Minimum size which forces the dynamic allocator to change its" - " allocation strategy"); - -/* - * The minimum free space, in percent, which must be available - * in a space map to continue allocations in a first-fit fashion. - * Once the space map's free space drops below this level we dynamically - * switch to using best-fit allocations. - */ -extern uint_t metaslab_df_free_pct; - -SYSCTL_UINT(_vfs_zfs_metaslab, OID_AUTO, df_free_pct, - CTLFLAG_RWTUN, &metaslab_df_free_pct, 0, - "The minimum free space, in percent, which must be available in a" - " space map to continue allocations in a first-fit fashion"); - /* mmp.c */ int diff --git a/module/zfs/metaslab.c b/module/zfs/metaslab.c index 959aa1b8384..2be1f281268 100644 --- a/module/zfs/metaslab.c +++ b/module/zfs/metaslab.c @@ -6443,6 +6443,14 @@ ZFS_MODULE_PARAM(zfs_metaslab, metaslab_, df_max_search, UINT, ZMOD_RW, ZFS_MODULE_PARAM(zfs_metaslab, metaslab_, df_use_largest_segment, INT, ZMOD_RW, "When looking in size tree, use largest segment instead of exact fit"); +ZFS_MODULE_PARAM(zfs_metaslab, metaslab_, df_alloc_threshold, U64, ZMOD_RW, + "Minimum size which forces the dynamic allocator to change its " + "allocation strategy"); + +ZFS_MODULE_PARAM(zfs_metaslab, metaslab_, df_free_pct, UINT, ZMOD_RW, + "The minimum free space, in percent, to continue allocations in a " + "first-fit fashion"); + ZFS_MODULE_PARAM(zfs_metaslab, zfs_metaslab_, max_size_cache_sec, U64, ZMOD_RW, "How long to trust the cached max chunk size of a metaslab");