aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/zthr.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2019-04-04 09:44:46 -0700
committerGitHub <[email protected]>2019-04-04 09:44:46 -0700
commitf4e35b165c1a3dff5c635fe89e7a52277731ca56 (patch)
tree94e34a8d8edcc0a2613d9ee4438b3f6f4104ec95 /module/zfs/zthr.c
parentce4432c5424eb9aa4d00833ee7529cf24491bdde (diff)
Fix txg_wait_open() load average inflation
Callers of txg_wait_open() which set should_quiesce=B_TRUE should be accounted for as iowait time. Otherwise, the caller is understood to be idle and cv_wait_sig() is used to prevent incorrectly inflating the system load average. Similarly txg_wait_wait() has been updated to use cv_wait_io() to be accounted against iowait. Reviewed-by: Tim Chase <[email protected]> Reviewed-by: Olaf Faaland <[email protected]> Reviewed-by: Matt Ahrens <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #8550 Closes #8558
Diffstat (limited to 'module/zfs/zthr.c')
-rw-r--r--module/zfs/zthr.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/module/zfs/zthr.c b/module/zfs/zthr.c
index dd8505caa..532e8ce0f 100644
--- a/module/zfs/zthr.c
+++ b/module/zfs/zthr.c
@@ -234,7 +234,11 @@ zthr_procedure(void *arg)
t->zthr_func(t->zthr_arg, t);
mutex_enter(&t->zthr_state_lock);
} else {
- /* go to sleep */
+ /*
+ * cv_wait_sig() is used instead of cv_wait() in
+ * order to prevent this process from incorrectly
+ * contributing to the system load average when idle.
+ */
if (t->zthr_wait_time == 0) {
cv_wait_sig(&t->zthr_cv, &t->zthr_state_lock);
} else {