aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/txg.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2011-03-31 17:07:12 -0700
committerBrian Behlendorf <[email protected]>2011-03-31 17:07:12 -0700
commitbfd214af01dd360417b1331d903655244979fe0f (patch)
tree2fbc8f582bfe96968e8f5d600f4166742bd102b9 /module/zfs/txg.c
parent1f5fd9d47815770fc8e0fea7028229fd0826871c (diff)
Fix inflated load average
Kernel threads which sleep uninterruptibly on Linux are marked in the (D) state. These threads are usually in the process of performing IO and are thus counted against the load average. The txg_quiesce and txg_sync threads were always sleeping uninterruptibly and thus inflating the load average. This change makes them sleep interruptibly. Some care is required however because these threads may now be woken early by signals. In this case the callers are all careful to check that the required conditions are met after waking up. If we're woken early due to a signal they will simply go back to sleep. In this case these changes are safe. Closes #175
Diffstat (limited to 'module/zfs/txg.c')
-rw-r--r--module/zfs/txg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/module/zfs/txg.c b/module/zfs/txg.c
index 5afb139dd..00c1c7d26 100644
--- a/module/zfs/txg.c
+++ b/module/zfs/txg.c
@@ -166,10 +166,10 @@ txg_thread_wait(tx_state_t *tx, callb_cpr_t *cpr, kcondvar_t *cv, uint64_t time)
CALLB_CPR_SAFE_BEGIN(cpr);
if (time)
- (void) cv_timedwait(cv, &tx->tx_sync_lock,
+ (void) cv_timedwait_interruptible(cv, &tx->tx_sync_lock,
ddi_get_lbolt() + time);
else
- cv_wait(cv, &tx->tx_sync_lock);
+ cv_wait_interruptible(cv, &tx->tx_sync_lock);
CALLB_CPR_SAFE_END(cpr, &tx->tx_sync_lock);
}