diff --git a/lib/libspl/include/sys/time.h b/lib/libspl/include/sys/time.h index f05fcaa1c6..dc645fa5c3 100644 --- a/lib/libspl/include/sys/time.h +++ b/lib/libspl/include/sys/time.h @@ -54,10 +54,14 @@ #define MSEC2NSEC(m) ((hrtime_t)(m) * (NANOSEC / MILLISEC)) #endif -#ifndef NSEC2MSEC +#ifndef NSEC2MSEC #define NSEC2MSEC(n) ((n) / (NANOSEC / MILLISEC)) #endif +#ifndef USEC2NSEC +#define USEC2NSEC(m) ((hrtime_t)(m) * (NANOSEC / MICROSEC)) +#endif + #ifndef NSEC2SEC #define NSEC2SEC(n) ((n) / (NANOSEC / SEC)) #endif diff --git a/module/zfs/mmp.c b/module/zfs/mmp.c index 15eea41abf..dc5c6a74f4 100644 --- a/module/zfs/mmp.c +++ b/module/zfs/mmp.c @@ -462,9 +462,9 @@ mmp_thread(spa_t *spa) 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); }