Prevent reclaim in metaslab preload threads

Reclaim during metaslab preloading can cause deadlocks involving znode
z_lock and ARC buffer header ht_lock.

Signed-off-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #3532.
This commit is contained in:
Tim Chase 2015-07-03 09:24:24 -05:00 committed by Brian Behlendorf
parent e16b3fcc61
commit 1cd777340b
1 changed files with 2 additions and 0 deletions

View File

@ -1579,6 +1579,7 @@ metaslab_preload(void *arg)
{
metaslab_t *msp = arg;
spa_t *spa = msp->ms_group->mg_vd->vdev_spa;
fstrans_cookie_t cookie = spl_fstrans_mark();
ASSERT(!MUTEX_HELD(&msp->ms_group->mg_lock));
@ -1592,6 +1593,7 @@ metaslab_preload(void *arg)
*/
msp->ms_access_txg = spa_syncing_txg(spa) + metaslab_unload_delay + 1;
mutex_exit(&msp->ms_lock);
spl_fstrans_unmark(cookie);
}
static void