svn commit: r339152 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Alexander Motin
mav at FreeBSD.org
Wed Oct 3 15:35:28 UTC 2018
Author: mav
Date: Wed Oct 3 15:35:27 2018
New Revision: 339152
URL: https://svnweb.freebsd.org/changeset/base/339152
Log:
MFC r337972: 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.
Modified:
stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
==============================================================================
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Wed Oct 3 15:34:49 2018 (r339151)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Wed Oct 3 15:35:27 2018 (r339152)
@@ -1090,7 +1090,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;
@@ -1131,6 +1131,13 @@ metaslab_group_allocatable(metaslab_group_t *mg, metas
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]);
/*
@@ -1151,7 +1158,7 @@ metaslab_group_allocatable(metaslab_group_t *mg, metas
*/
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]);
@@ -3437,7 +3444,7 @@ top:
*/
if (allocatable && !GANG_ALLOCATION(flags) && !try_hard) {
allocatable = metaslab_group_allocatable(mg, rotor,
- psize, allocator);
+ psize, allocator, d);
}
if (!allocatable) {
More information about the svn-src-stable
mailing list