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 <tim@chase2k.com>
Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
Reviewed-by: Matt Ahrens <mahrens@delphix.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #8550
Closes #8558
This commit is contained in:
Brian Behlendorf
2019-04-04 09:44:46 -07:00
committed by GitHub
parent ce4432c542
commit f4e35b165c
2 changed files with 25 additions and 5 deletions
+5 -1
View File
@@ -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 {