Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Apr 2014 15:58:06 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r264505 - in stable: 8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201404151558.s3FFw6DB005724@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Tue Apr 15 15:58:06 2014
New Revision: 264505
URL: http://svnweb.freebsd.org/changeset/base/264505

Log:
  Don't pass a timeout of 0 ticks to pause() for a delay of less than 1
  hz tick.  On 8.x this results in an infinite sleep as pause() does not
  support a delay of 0 ticks.  Since all delay values are converted from
  nanoseconds to ticks using a floor function, skipping the sleep for a
  delay smaller than 1 tick is the more consistent than rounding up to a
  single tick.
  
  This is a direct commit to 8 and 9 as 10.x and later use pause_sbt()
  instead.
  
  Reviewed by:	avg

Modified:
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c

Changes in other areas also in this revision:
Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c	Tue Apr 15 15:41:57 2014	(r264504)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c	Tue Apr 15 15:58:06 2014	(r264505)
@@ -1062,9 +1062,13 @@ dmu_tx_delay(dmu_tx_t *tx, uint64_t dirt
 		continue;
 	mutex_exit(&curthread->t_delay_lock);
 #else
+	int timo;
+
 	/* XXX High resolution callouts are not available */
 	ASSERT(wakeup >= now);
-	pause("dmu_tx_delay", NSEC_TO_TICK(wakeup - now));
+	timo = NSEC_TO_TICK(wakeup - now);
+	if (timo != 0)
+		pause("dmu_tx_delay", timo);
 #endif
 #else
 	hrtime_t delta = wakeup - gethrtime();



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