mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
OpenZFS 7303 - dynamic metaslab selection
This change introduces a new weighting algorithm to improve metaslab selection. The new weighting algorithm relies on the SPACEMAP_HISTOGRAM feature. As a result, the metaslab weight now encodes the type of weighting algorithm used (size-based vs segment-based). Porting Notes: The metaslab allocation tracing code is conditionally removed on linux (dependent on mdb debugger). Authored by: George Wilson <george.wilson@delphix.com> Reviewed by: Alex Reece <alex@delphix.com> Reviewed by: Chris Siden <christopher.siden@delphix.com> Reviewed by: Dan Kimmel <dan.kimmel@delphix.com> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Paul Dagnelie <paul.dagnelie@delphix.com> Reviewed by: Pavel Zakharov pavel.zakharov@delphix.com Reviewed by: Prakash Surya <prakash.surya@delphix.com> Reviewed by: Don Brady <don.brady@intel.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Ported-by: Don Brady <don.brady@intel.com> OpenZFS-issue: https://www.illumos.org/issues/7303 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/d5190931bd Closes #5404
This commit is contained in:
committed by
Brian Behlendorf
parent
5727b00e06
commit
4e21fd060a
+19
-4
@@ -2643,10 +2643,21 @@ zdb_leak_init(spa_t *spa, zdb_cb_t *zcb)
|
||||
|
||||
if (!dump_opt['L']) {
|
||||
vdev_t *rvd = spa->spa_root_vdev;
|
||||
|
||||
/*
|
||||
* We are going to be changing the meaning of the metaslab's
|
||||
* ms_tree. Ensure that the allocator doesn't try to
|
||||
* use the tree.
|
||||
*/
|
||||
spa->spa_normal_class->mc_ops = &zdb_metaslab_ops;
|
||||
spa->spa_log_class->mc_ops = &zdb_metaslab_ops;
|
||||
|
||||
for (c = 0; c < rvd->vdev_children; c++) {
|
||||
vdev_t *vd = rvd->vdev_child[c];
|
||||
metaslab_group_t *mg = vd->vdev_mg;
|
||||
for (m = 0; m < vd->vdev_ms_count; m++) {
|
||||
metaslab_t *msp = vd->vdev_ms[m];
|
||||
ASSERT3P(msp->ms_group, ==, mg);
|
||||
mutex_enter(&msp->ms_lock);
|
||||
metaslab_unload(msp);
|
||||
|
||||
@@ -2667,8 +2678,6 @@ zdb_leak_init(spa_t *spa, zdb_cb_t *zcb)
|
||||
(longlong_t)m,
|
||||
(longlong_t)vd->vdev_ms_count);
|
||||
|
||||
msp->ms_ops = &zdb_metaslab_ops;
|
||||
|
||||
/*
|
||||
* We don't want to spend the CPU
|
||||
* manipulating the size-ordered
|
||||
@@ -2678,7 +2687,9 @@ zdb_leak_init(spa_t *spa, zdb_cb_t *zcb)
|
||||
msp->ms_tree->rt_ops = NULL;
|
||||
VERIFY0(space_map_load(msp->ms_sm,
|
||||
msp->ms_tree, SM_ALLOC));
|
||||
msp->ms_loaded = B_TRUE;
|
||||
|
||||
if (!msp->ms_loaded)
|
||||
msp->ms_loaded = B_TRUE;
|
||||
}
|
||||
mutex_exit(&msp->ms_lock);
|
||||
}
|
||||
@@ -2702,8 +2713,10 @@ zdb_leak_fini(spa_t *spa)
|
||||
vdev_t *rvd = spa->spa_root_vdev;
|
||||
for (c = 0; c < rvd->vdev_children; c++) {
|
||||
vdev_t *vd = rvd->vdev_child[c];
|
||||
metaslab_group_t *mg = vd->vdev_mg;
|
||||
for (m = 0; m < vd->vdev_ms_count; m++) {
|
||||
metaslab_t *msp = vd->vdev_ms[m];
|
||||
ASSERT3P(mg, ==, msp->ms_group);
|
||||
mutex_enter(&msp->ms_lock);
|
||||
|
||||
/*
|
||||
@@ -2717,7 +2730,9 @@ zdb_leak_fini(spa_t *spa)
|
||||
* from the ms_tree.
|
||||
*/
|
||||
range_tree_vacate(msp->ms_tree, zdb_leak, vd);
|
||||
msp->ms_loaded = B_FALSE;
|
||||
|
||||
if (msp->ms_loaded)
|
||||
msp->ms_loaded = B_FALSE;
|
||||
|
||||
mutex_exit(&msp->ms_lock);
|
||||
}
|
||||
|
||||
+1
-1
@@ -178,7 +178,7 @@ static const ztest_shared_opts_t ztest_opts_defaults = {
|
||||
.zo_mirrors = 2,
|
||||
.zo_raidz = 4,
|
||||
.zo_raidz_parity = 1,
|
||||
.zo_vdev_size = SPA_MINDEVSIZE * 2,
|
||||
.zo_vdev_size = SPA_MINDEVSIZE * 4, /* 256m default size */
|
||||
.zo_datasets = 7,
|
||||
.zo_threads = 23,
|
||||
.zo_passtime = 60, /* 60 seconds */
|
||||
|
||||
Reference in New Issue
Block a user