From 514af1a14333aff2f5f64632ce759de69922d353 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 9 Mar 2018 15:15:19 -0800 Subject: [PATCH] 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 thus could be fairly easily reproduced with a reasonably large pool. Most distribution kernels set CONFIG_HZ=250 or CONFIG_HZ=1000 thus are unlikely to be impacted. Signed-off-by: Brian Behlendorf Issue #7205 --- module/zfs/mmp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/zfs/mmp.c b/module/zfs/mmp.c index cb0aa53d6a48..55275e17279b 100644 --- a/module/zfs/mmp.c +++ b/module/zfs/mmp.c @@ -521,9 +521,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); }