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 openzfs#15781
  • Loading branch information
jxdking authored and lundman committed Mar 13, 2024
1 parent a885a98 commit d104cc2
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 @@ -196,7 +196,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 d104cc2

Please sign in to comment.