aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2019-06-03 17:14:54 +0000
committerAlexander Motin <mav@FreeBSD.org>2019-06-03 17:14:54 +0000
commit299ed57f93e3bb2d334f247bcfc0cc77a169a65b (patch)
treed375de692178de943e784c70fa1f9308afa9a9a0
parente5cd1b9d0706ad0124bf40f99dad7a62e3e4f449 (diff)
downloadsrc-299ed57f93e3bb2d334f247bcfc0cc77a169a65b.tar.gz
src-299ed57f93e3bb2d334f247bcfc0cc77a169a65b.zip
9738 9112 broke third block copy allocations within one metaslab group
illumos/illumos-gate@b86e7e3f0e50748bb5bb5cc91632d72ff17f08dd Reviewed by: Paul Dagnelie <pcd@delphix.com> Reviewed by: George Wilson <george.wilson@delphix.com> Approved by: Robert Mustacchi <rm@joyent.com> Author: Alexander Motin <mav@FreeBSD.org>
Notes
Notes: svn path=/vendor-sys/illumos/dist/; revision=348556
-rw-r--r--uts/common/fs/zfs/metaslab.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/uts/common/fs/zfs/metaslab.c b/uts/common/fs/zfs/metaslab.c
index b965654872f7..90cd7336c682 100644
--- a/uts/common/fs/zfs/metaslab.c
+++ b/uts/common/fs/zfs/metaslab.c
@@ -3080,7 +3080,6 @@ metaslab_group_alloc_normal(metaslab_group_t *mg, zio_alloc_list_t *zal,
metaslab_t *msp = NULL;
uint64_t offset = -1ULL;
uint64_t activation_weight;
- boolean_t tertiary = B_FALSE;
activation_weight = METASLAB_WEIGHT_PRIMARY;
for (int i = 0; i < d; i++) {
@@ -3089,7 +3088,7 @@ metaslab_group_alloc_normal(metaslab_group_t *mg, zio_alloc_list_t *zal,
activation_weight = METASLAB_WEIGHT_SECONDARY;
} else if (activation_weight == METASLAB_WEIGHT_SECONDARY &&
DVA_GET_VDEV(&dva[i]) == mg->mg_vd->vdev_id) {
- tertiary = B_TRUE;
+ activation_weight = METASLAB_WEIGHT_CLAIM;
break;
}
}
@@ -3098,10 +3097,8 @@ metaslab_group_alloc_normal(metaslab_group_t *mg, zio_alloc_list_t *zal,
* If we don't have enough metaslabs active to fill the entire array, we
* just use the 0th slot.
*/
- if (mg->mg_ms_ready < mg->mg_allocators * 2) {
- tertiary = B_FALSE;
+ if (mg->mg_ms_ready < mg->mg_allocators * 3)
allocator = 0;
- }
ASSERT3U(mg->mg_vd->vdev_ms_count, >=, 2);
@@ -3127,7 +3124,7 @@ metaslab_group_alloc_normal(metaslab_group_t *mg, zio_alloc_list_t *zal,
msp = mg->mg_primaries[allocator];
was_active = B_TRUE;
} else if (activation_weight == METASLAB_WEIGHT_SECONDARY &&
- mg->mg_secondaries[allocator] != NULL && !tertiary) {
+ mg->mg_secondaries[allocator] != NULL) {
msp = mg->mg_secondaries[allocator];
was_active = B_TRUE;
} else {
@@ -3170,7 +3167,8 @@ metaslab_group_alloc_normal(metaslab_group_t *mg, zio_alloc_list_t *zal,
continue;
}
- if (msp->ms_weight & METASLAB_WEIGHT_CLAIM) {
+ if (msp->ms_weight & METASLAB_WEIGHT_CLAIM &&
+ activation_weight != METASLAB_WEIGHT_CLAIM) {
metaslab_passivate(msp, msp->ms_weight &
~METASLAB_WEIGHT_CLAIM);
mutex_exit(&msp->ms_lock);