mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 03:08:51 +03:00
Fix short-lived txg caused by autotrim
Current autotrim causes short-lived txg through: 1. calling txg_wait_synced() in metaslab_enable() 2. calling txg_wait_open() with should_quiesce = true This patch addresses all the issues mentioned above. A new cv, vdev_autotrim_kick_cv is added to kick autotrim activity. It will be signaled once a txg is synced so that it does not change the original autotrim pace. Also because it is a cv, the wait is interruptible which speeds up the vdev_autotrim_stop_wait() call. Finally, combining big zfs_txg_timeout, txg_wait_open() also causes delay when exporting a pool. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: jxdking <lostking2008@hotmail.com> Issue #8993 Closes #12194
This commit is contained in:
@@ -696,6 +696,7 @@ vdev_alloc_common(spa_t *spa, uint_t id, uint64_t guid, vdev_ops_t *ops)
|
||||
mutex_init(&vd->vdev_trim_io_lock, NULL, MUTEX_DEFAULT, NULL);
|
||||
cv_init(&vd->vdev_trim_cv, NULL, CV_DEFAULT, NULL);
|
||||
cv_init(&vd->vdev_autotrim_cv, NULL, CV_DEFAULT, NULL);
|
||||
cv_init(&vd->vdev_autotrim_kick_cv, NULL, CV_DEFAULT, NULL);
|
||||
cv_init(&vd->vdev_trim_io_cv, NULL, CV_DEFAULT, NULL);
|
||||
|
||||
mutex_init(&vd->vdev_rebuild_lock, NULL, MUTEX_DEFAULT, NULL);
|
||||
@@ -1148,6 +1149,7 @@ vdev_free(vdev_t *vd)
|
||||
mutex_destroy(&vd->vdev_trim_io_lock);
|
||||
cv_destroy(&vd->vdev_trim_cv);
|
||||
cv_destroy(&vd->vdev_autotrim_cv);
|
||||
cv_destroy(&vd->vdev_autotrim_kick_cv);
|
||||
cv_destroy(&vd->vdev_trim_io_cv);
|
||||
|
||||
mutex_destroy(&vd->vdev_rebuild_lock);
|
||||
|
||||
Reference in New Issue
Block a user