summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2018-03-12 11:26:05 -0700
committerGitHub <[email protected]>2018-03-12 11:26:05 -0700
commitb7eec00f9fc05e883b0dadb231251b5996d02e3e (patch)
treefc9b4f58297aeba6979c7b58478d98070443b2c0
parent743253df70e9d9772cf98fcdd0fb7f42398d4ff8 (diff)
Fix MMP write frequency for large pools
When a single pool contains more vdevs than the CONFIG_HZ for for the kernel the mmp thread will not delay properly. Switch to using cv_timedwait_sig_hires() to handle higher resolution delays. This issue was reported on Arch Linux where HZ defaults to only 100 and this could be fairly easily reproduced with a reasonably large pool. Most distribution kernels set CONFIG_HZ=250 or CONFIG_HZ=1000 and thus are unlikely to be impacted. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Reviewed-by: Olaf Faaland <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #7205 Closes #7289
-rw-r--r--module/zfs/mmp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/module/zfs/mmp.c b/module/zfs/mmp.c
index 420b8441c..757dfa82d 100644
--- a/module/zfs/mmp.c
+++ b/module/zfs/mmp.c
@@ -527,9 +527,9 @@ mmp_thread(void *arg)
mmp_write_uberblock(spa);
CALLB_CPR_SAFE_BEGIN(&cpr);
- (void) cv_timedwait_sig(&mmp->mmp_thread_cv,
- &mmp->mmp_thread_lock, ddi_get_lbolt() +
- ((next_time - gethrtime()) / (NANOSEC / hz)));
+ (void) cv_timedwait_sig_hires(&mmp->mmp_thread_cv,
+ &mmp->mmp_thread_lock, next_time, USEC2NSEC(1),
+ CALLOUT_FLAG_ABSOLUTE);
CALLB_CPR_SAFE_END(&cpr, &mmp->mmp_thread_lock);
}