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.

Signed-off-by: jxdking <[email protected]>
  • Loading branch information
jxdking committed Jan 16, 2024
1 parent a1771d2 commit 6bdceb6
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 6bdceb6

Please sign in to comment.