From 5fce0b08098955ad2f9927170e1a41a12a539953 Mon Sep 17 00:00:00 2001 From: Xin LI Date: Sat, 4 Oct 2014 07:34:50 +0000 Subject: [PATCH] 5161 add tunable for number of metaslabs per vdev Reviewed by: Alex Reece Reviewed by: Christopher Siden Reviewed by: George Wilson Reviewed by: Paul Dagnelie Reviewed by: Saso Kiselkov Reviewed by: Richard Elling Approved by: Richard Lowe Author: Matthew Ahrens illumos/illumos-gate@bf3e216c7efa56332b456f4cf19d208e21d63839 --- uts/common/fs/zfs/vdev.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/uts/common/fs/zfs/vdev.c b/uts/common/fs/zfs/vdev.c index 28ef0414a280..7571b21a5f8c 100644 --- a/uts/common/fs/zfs/vdev.c +++ b/uts/common/fs/zfs/vdev.c @@ -64,6 +64,12 @@ static vdev_ops_t *vdev_ops_table[] = { /* maximum scrub/resilver I/O queue per leaf vdev */ int zfs_scrub_limit = 10; +/* + * When a vdev is added, it will be divided into approximately (but no + * more than) this number of metaslabs. + */ +int metaslabs_per_vdev = 200; + /* * Given a vdev type, return the appropriate ops vector. */ @@ -1551,9 +1557,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); }