mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 03:08:51 +03:00
spa_misc: add an API for spa_namespace_lock
This is useful as debugging support, as it lets namespace lock operations be traced directly. It will also be useful for future work to reduce the use of spa_namespace_lock, traditionally a source of difficult deadlocks. Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Signed-off-by: Rob Norris <rob.norris@klarasystems.com> Closes #17906
This commit is contained in:
committed by
Brian Behlendorf
parent
e305c7d596
commit
ac0bc4cc00
+4
-4
@@ -8548,7 +8548,7 @@ l2arc_dev_get_next(void)
|
||||
* of cache devices (l2arc_dev_mtx). Once a device has been selected,
|
||||
* both locks will be dropped and a spa config lock held instead.
|
||||
*/
|
||||
mutex_enter(&spa_namespace_lock);
|
||||
spa_namespace_enter(FTAG);
|
||||
mutex_enter(&l2arc_dev_mtx);
|
||||
|
||||
/* if there are no vdevs, there is nothing to do */
|
||||
@@ -8591,7 +8591,7 @@ out:
|
||||
*/
|
||||
if (next != NULL)
|
||||
spa_config_enter(next->l2ad_spa, SCL_L2ARC, next, RW_READER);
|
||||
mutex_exit(&spa_namespace_lock);
|
||||
spa_namespace_exit(FTAG);
|
||||
|
||||
return (next);
|
||||
}
|
||||
@@ -10231,7 +10231,7 @@ l2arc_stop(void)
|
||||
void
|
||||
l2arc_spa_rebuild_start(spa_t *spa)
|
||||
{
|
||||
ASSERT(MUTEX_HELD(&spa_namespace_lock));
|
||||
ASSERT(spa_namespace_held());
|
||||
|
||||
/*
|
||||
* Locate the spa's l2arc devices and kick off rebuild threads.
|
||||
@@ -10256,7 +10256,7 @@ l2arc_spa_rebuild_start(spa_t *spa)
|
||||
void
|
||||
l2arc_spa_rebuild_stop(spa_t *spa)
|
||||
{
|
||||
ASSERT(MUTEX_HELD(&spa_namespace_lock) ||
|
||||
ASSERT(spa_namespace_held() ||
|
||||
spa->spa_export_thread == curthread);
|
||||
|
||||
for (int i = 0; i < spa->spa_l2cache.sav_count; i++) {
|
||||
|
||||
Reference in New Issue
Block a user