Skip to content

Commit

Permalink
Autotrim High Load Average Fix
Browse files Browse the repository at this point in the history
Switch from cv_wait() to cv_wait_idle() in vdev_autotrim_wait_kick(),
which should mitigate the high load average while waiting.

Reviewed-by: Brian Atkinson <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: jxdking <[email protected]>
Closes #15781
  • Loading branch information
jxdking authored and behlendorf committed Jan 18, 2024
1 parent 2ecc2df commit 07cf973
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion module/zfs/vdev_trim.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ vdev_autotrim_wait_kick(vdev_t *vd, int num_of_kick)
for (int i = 0; i < num_of_kick; i++) {
if (vd->vdev_autotrim_exit_wanted)
break;
cv_wait(&vd->vdev_autotrim_kick_cv, &vd->vdev_autotrim_lock);
cv_wait_idle(&vd->vdev_autotrim_kick_cv,
&vd->vdev_autotrim_lock);
}
boolean_t exit_wanted = vd->vdev_autotrim_exit_wanted;
mutex_exit(&vd->vdev_autotrim_lock);
Expand Down

0 comments on commit 07cf973

Please sign in to comment.