Skip to content

Commit

Permalink
Autotrim High CPU Usage Fix
Browse files Browse the repository at this point in the history
Switch from cv_wait() to cv_wait_idle() inside vdev_autotrim_wait_kick(), which should mitigate the high CPU usage while waiting.

Signed-off-by: jxdking <[email protected]>
  • Loading branch information
jxdking authored Jan 16, 2024
1 parent a1771d2 commit 55f8363
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/zfs/vdev_trim.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ 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);

Check failure on line 199 in module/zfs/vdev_trim.c

View workflow job for this annotation

GitHub Actions / checkstyle

line > 80 characters
}
boolean_t exit_wanted = vd->vdev_autotrim_exit_wanted;
mutex_exit(&vd->vdev_autotrim_lock);
Expand Down

0 comments on commit 55f8363

Please sign in to comment.