From owner-svn-src-all@FreeBSD.ORG Sun Aug 3 09:47:52 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 061E1C34 for ; Sun, 3 Aug 2014 09:47:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD1BE259F for ; Sun, 3 Aug 2014 09:47:51 +0000 (UTC) Received: from delphij (uid 1035) (envelope-from delphij@svn.freebsd.org) id 5601 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Sun, 03 Aug 2014 09:47:51 +0000 From: Xin LI Date: Sun, 3 Aug 2014 09:47:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269466 - in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53de0547.5601.7c60e05f@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 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: Sun, 03 Aug 2014 09:47:52 -0000 Author: delphij Date: Sun Aug 3 09:47:51 2014 New Revision: 269466 URL: http://svnweb.freebsd.org/changeset/base/269466 Log: Revert r269404 and use cpu_ticks() for dbuf allocation. Encode CPU's number by XOR'ing the CPU ID against the 64-bit cpu_ticks(). Reviewed by: mav, gibbs Differential Revision: https://phabric.freebsd.org/D521 MFC after: 2 weeks Modified: head/sys/cddl/compat/opensolaris/sys/time.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Modified: head/sys/cddl/compat/opensolaris/sys/time.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/time.h Sun Aug 3 09:40:50 2014 (r269465) +++ head/sys/cddl/compat/opensolaris/sys/time.h Sun Aug 3 09:47:51 2014 (r269466) @@ -60,17 +60,6 @@ gethrtime(void) { struct timespec ts; hrtime_t nsec; - nanouptime(&ts); - nsec = (hrtime_t)ts.tv_sec * NANOSEC + ts.tv_nsec; - return (nsec); -} - -static __inline hrtime_t -gethrtime_waitfree(void) { - - struct timespec ts; - hrtime_t nsec; - getnanouptime(&ts); nsec = (hrtime_t)ts.tv_sec * NANOSEC + ts.tv_nsec; return (nsec); @@ -78,6 +67,7 @@ gethrtime_waitfree(void) { #define gethrestime_sec() (time_second) #define gethrestime(ts) getnanotime(ts) +#define gethrtime_waitfree() gethrtime() extern int nsec_per_tick; /* nanoseconds per clock tick */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sun Aug 3 09:40:50 2014 (r269465) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sun Aug 3 09:47:51 2014 (r269466) @@ -70,7 +70,11 @@ dbuf_cons(void *vdb, void *unused, int k cv_init(&db->db_changed, NULL, CV_DEFAULT, NULL); refcount_create(&db->db_holds); +#if defined(illumos) || !defined(_KERNEL) db->db_creation = gethrtime(); +#else + db->db_creation = cpu_ticks() ^ ((uint64_t)CPU_SEQID << 48); +#endif return (0); }