aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/zthr.c
diff options
context:
space:
mode:
authorMatthew Macy <[email protected]>2020-09-03 20:04:09 -0700
committerGitHub <[email protected]>2020-09-03 20:04:09 -0700
commitac6e5fb202a95277cd7886eb7b6acc3ec53d8def (patch)
treeb016a947bae0eee38318eca6c19d619045a7de65 /module/zfs/zthr.c
parentf30703f6fc831bdeb5e7a11b5f1c01d6d9cb7799 (diff)
Replace cv_{timed}wait_sig with cv_{timed}wait_idle where appropriate
There are a number of places where cv_?_sig is used simply for accounting purposes but the surrounding code has no ability to cope with actually receiving a signal. On FreeBSD it is possible to send signals to individual kernel threads so this could enable undesirable behavior. This patch adds routines on Linux that will do the same idle accounting as _sig without making the task interruptible. On FreeBSD cv_*_idle are all aliases for cv_* Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #10843
Diffstat (limited to 'module/zfs/zthr.c')
-rw-r--r--module/zfs/zthr.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/module/zfs/zthr.c b/module/zfs/zthr.c
index fdc4b8633..e230cd2cb 100644
--- a/module/zfs/zthr.c
+++ b/module/zfs/zthr.c
@@ -237,15 +237,10 @@ zthr_procedure(void *arg)
t->zthr_func(t->zthr_arg, t);
mutex_enter(&t->zthr_state_lock);
} else {
- /*
- * 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_sleep_timeout == 0) {
- cv_wait_sig(&t->zthr_cv, &t->zthr_state_lock);
+ cv_wait_idle(&t->zthr_cv, &t->zthr_state_lock);
} else {
- (void) cv_timedwait_sig_hires(&t->zthr_cv,
+ (void) cv_timedwait_idle_hires(&t->zthr_cv,
&t->zthr_state_lock, t->zthr_sleep_timeout,
MSEC2NSEC(1), 0);
}