From 1f02ecc5a56d08b744b618c641505c451bd9b1e4 Mon Sep 17 00:00:00 2001 From: DeHackEd Date: Tue, 7 May 2019 18:34:42 -0400 Subject: [PATCH] Make zfs_special_class_metadata_reserve_pct into a parameter Exported and documented a new module parameter. Reviewed-by: Richard Laager Reviewed-by: Brian Behlendorf Signed-off-by: DHE Closes #8706 --- man/man5/zfs-module-parameters.5 | 14 ++++++++++++++ module/zfs/spa_misc.c | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/man/man5/zfs-module-parameters.5 b/man/man5/zfs-module-parameters.5 index 5c49670f1..5bca12e06 100644 --- a/man/man5/zfs-module-parameters.5 +++ b/man/man5/zfs-module-parameters.5 @@ -2399,6 +2399,20 @@ vdev while discarding the checkpoint. Default value: \fB16,777,216\fR. .RE +.sp +.ne 2 +.na +\fBzfs_special_class_metadata_reserve_pct\fR (int) +.ad +.RS 12n +Only allow small data blocks to be allocated on the special and dedup vdev +types when the available free space percentage on these vdevs exceeds this +value. This ensures reserved space is available for pool meta data as the +special vdevs approach capacity. +.sp +Default value: \fB25\fR. +.RE + .sp .ne 2 .na diff --git a/module/zfs/spa_misc.c b/module/zfs/spa_misc.c index b3a4a7b12..f4497ca1c 100644 --- a/module/zfs/spa_misc.c +++ b/module/zfs/spa_misc.c @@ -2689,5 +2689,10 @@ MODULE_PARM_DESC(zfs_ddt_data_is_special, module_param(zfs_user_indirect_is_special, int, 0644); MODULE_PARM_DESC(zfs_user_indirect_is_special, "Place user data indirect blocks into the special class"); + +module_param(zfs_special_class_metadata_reserve_pct, int, 0644); +MODULE_PARM_DESC(zfs_special_class_metadata_reserve_pct, + "Small file blocks in special vdevs depends on this much " + "free space available"); /* END CSTYLED */ #endif