Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Sep 2017 15:03:27 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r323985 - in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201709251503.v8PF3Rbp003823@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Mon Sep 25 15:03:27 2017
New Revision: 323985
URL: https://svnweb.freebsd.org/changeset/base/323985

Log:
  Use nstosbt() instead of multiplying by SBT_1NS to avoid roundoff errors.
  
  Differential Revision:	https://reviews.freebsd.org/D11779

Modified:
  head/sys/cddl/compat/opensolaris/sys/kcondvar.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c

Modified: head/sys/cddl/compat/opensolaris/sys/kcondvar.h
==============================================================================
--- head/sys/cddl/compat/opensolaris/sys/kcondvar.h	Mon Sep 25 11:38:58 2017	(r323984)
+++ head/sys/cddl/compat/opensolaris/sys/kcondvar.h	Mon Sep 25 15:03:27 2017	(r323985)
@@ -63,13 +63,8 @@ static clock_t
 cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t tim, hrtime_t res,
     int flag)
 {
-	sbintime_t sbt;
-	sbintime_t pr;
 
-	sbt = tim * SBT_1NS;
-	pr = res * SBT_1NS;
-
-	return (cv_timedwait_sbt(cvp, mp, sbt, pr, 0));
+	return (cv_timedwait_sbt(cvp, mp, nstosbt(tim), nstosbt(res), 0));
 }
 
 #endif	/* _KERNEL */

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c	Mon Sep 25 11:38:58 2017	(r323984)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c	Mon Sep 25 15:03:27 2017	(r323985)
@@ -806,8 +806,8 @@ dmu_tx_delay(dmu_tx_t *tx, uint64_t dirty)
 		continue;
 	mutex_exit(&curthread->t_delay_lock);
 #else
-	pause_sbt("dmu_tx_delay", wakeup * SBT_1NS,
-	    zfs_delay_resolution_ns * SBT_1NS, C_ABSOLUTE);
+	pause_sbt("dmu_tx_delay", nstosbt(wakeup),
+	    nstosbt(zfs_delay_resolution_ns), C_ABSOLUTE);
 #endif
 #else
 	hrtime_t delta = wakeup - gethrtime();



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709251503.v8PF3Rbp003823>