From owner-svn-src-all@FreeBSD.ORG Tue Apr 15 15:58:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22592AF8; Tue, 15 Apr 2014 15:58:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E6AE1B4D; Tue, 15 Apr 2014 15:58:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3FFw65A005731; Tue, 15 Apr 2014 15:58:06 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3FFw6wO005730; Tue, 15 Apr 2014 15:58:06 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201404151558.s3FFw6wO005730@svn.freebsd.org> From: John Baldwin Date: Tue, 15 Apr 2014 15:58:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@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 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 15:58:07 -0000 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/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Changes in other areas also in this revision: Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Tue Apr 15 15:41:57 2014 (r264504) +++ stable/9/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();