diff options
author | Alexander Motin <mav@FreeBSD.org> | 2018-08-17 15:17:09 +0000 |
---|---|---|
committer | Alexander Motin <mav@FreeBSD.org> | 2018-08-17 15:17:09 +0000 |
commit | cd2315086a82b44c66458cada2404c4efff94af0 (patch) | |
tree | bf51e1b0448033eaaee5e093e05574f4b7b0c4e0 /sys/cddl/contrib/opensolaris/uts/common/fs | |
parent | 2848a0e2da030de96b64f8b138855f1596afa8db (diff) | |
download | src-cd2315086a82b44c66458cada2404c4efff94af0.tar.gz src-cd2315086a82b44c66458cada2404c4efff94af0.zip |
9751 Allocation throttling misplacing ditto blocks
Relax allocation throttling for ditto blocks. Due to random imbalances
in allocation it tends to push block copies to one vdev, that looks
slightly better at the moment. Slightly less strict policy allows both
improve data security and surprisingly write performance, since we don't
need to touch extra metaslabs on each vdev to respect the min distance.
Sponsored by: iXsystems, Inc.
Notes
Notes:
svn path=/head/; revision=337972
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c index 17b126248ca3..7e98ad65046e 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c @@ -1081,7 +1081,7 @@ metaslab_group_fragmentation(metaslab_group_t *mg) */ static boolean_t metaslab_group_allocatable(metaslab_group_t *mg, metaslab_group_t *rotor, - uint64_t psize, int allocator) + uint64_t psize, int allocator, int d) { spa_t *spa = mg->mg_vd->vdev_spa; metaslab_class_t *mc = mg->mg_class; @@ -1122,6 +1122,13 @@ metaslab_group_allocatable(metaslab_group_t *mg, metaslab_group_t *rotor, if (mg->mg_no_free_space) return (B_FALSE); + /* + * Relax allocation throttling for ditto blocks. Due to + * random imbalances in allocation it tends to push copies + * to one vdev, that looks a bit better at the moment. + */ + qmax = qmax * (4 + d) / 4; + qdepth = refcount_count(&mg->mg_alloc_queue_depth[allocator]); /* @@ -1142,7 +1149,7 @@ metaslab_group_allocatable(metaslab_group_t *mg, metaslab_group_t *rotor, */ for (mgp = mg->mg_next; mgp != rotor; mgp = mgp->mg_next) { qmax = mgp->mg_cur_max_alloc_queue_depth[allocator]; - + qmax = qmax * (4 + d) / 4; qdepth = refcount_count( &mgp->mg_alloc_queue_depth[allocator]); @@ -3424,7 +3431,7 @@ top: */ if (allocatable && !GANG_ALLOCATION(flags) && !try_hard) { allocatable = metaslab_group_allocatable(mg, rotor, - psize, allocator); + psize, allocator, d); } if (!allocatable) { |