summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorMatthew Ahrens <[email protected]>2014-09-13 16:13:00 +0200
committerBrian Behlendorf <[email protected]>2014-09-23 10:00:02 -0700
commitb8bcca18f709abd3d1b7649ebdcb4aeab1e2eb61 (patch)
treef342c4b712ceed9a3b3576b01b878c805a50cdeb /module
parentebcf49365a05fc064bfe6534c2997f3ad6c339e3 (diff)
Illumos 5161 - add tunable for number of metaslabs per vdev
5161 add tunable for number of metaslabs per vdev Reviewed by: Alex Reece <[email protected]> Reviewed by: Christopher Siden <[email protected]> Reviewed by: George Wilson <[email protected]> Reviewed by: Paul Dagnelie <[email protected]> Reviewed by: Saso Kiselkov <[email protected]> Reviewed by: Richard Elling <[email protected]> Approved by: Richard Lowe <[email protected]> References: https://www.illumos.org/issues/5161 https://github.com/illumos/illumos-gate/commit/bf3e216 Ported by: Turbo Fredriksson <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #2698
Diffstat (limited to 'module')
-rw-r--r--module/zfs/vdev.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/module/zfs/vdev.c b/module/zfs/vdev.c
index 7c689b3c8..45315d3a1 100644
--- a/module/zfs/vdev.c
+++ b/module/zfs/vdev.c
@@ -46,6 +46,12 @@
#include <sys/zvol.h>
/*
+ * When a vdev is added, it will be divided into approximately (but no
+ * more than) this number of metaslabs.
+ */
+int metaslabs_per_vdev = 200;
+
+/*
* Virtual device management.
*/
@@ -1582,9 +1588,9 @@ void
vdev_metaslab_set_size(vdev_t *vd)
{
/*
- * Aim for roughly 200 metaslabs per vdev.
+ * Aim for roughly metaslabs_per_vdev (default 200) metaslabs per vdev.
*/
- vd->vdev_ms_shift = highbit64(vd->vdev_asize / 200);
+ vd->vdev_ms_shift = highbit64(vd->vdev_asize / metaslabs_per_vdev);
vd->vdev_ms_shift = MAX(vd->vdev_ms_shift, SPA_MAXBLOCKSHIFT);
}
@@ -3387,4 +3393,9 @@ EXPORT_SYMBOL(vdev_degrade);
EXPORT_SYMBOL(vdev_online);
EXPORT_SYMBOL(vdev_offline);
EXPORT_SYMBOL(vdev_clear);
+
+module_param(metaslabs_per_vdev, int, 0644);
+MODULE_PARM_DESC(metaslabs_per_vdev,
+ "Divide added vdev into approximately (but no more than) this number "
+ "of metaslabs");
#endif