diff options
author | delphij <delphij@FreeBSD.org> | 2014-08-03 09:47:51 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2014-08-03 09:47:51 +0000 |
commit | 6ba22f8d1a754be2ddd46bea93f513a0980caa7c (patch) | |
tree | 0cac2148bcf12b99df5940fed8b56243e7b19ff4 | |
parent | a58252fd9a47e60a825c6d5001a1c41528c5d0fa (diff) | |
download | FreeBSD-src-6ba22f8d1a754be2ddd46bea93f513a0980caa7c.zip FreeBSD-src-6ba22f8d1a754be2ddd46bea93f513a0980caa7c.tar.gz |
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
-rw-r--r-- | sys/cddl/compat/opensolaris/sys/time.h | 12 | ||||
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c | 4 |
2 files changed, 5 insertions, 11 deletions
diff --git a/sys/cddl/compat/opensolaris/sys/time.h b/sys/cddl/compat/opensolaris/sys/time.h index cab715f..fe4857a 100644 --- a/sys/cddl/compat/opensolaris/sys/time.h +++ b/sys/cddl/compat/opensolaris/sys/time.h @@ -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 */ diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c index 3183c1c..9275601 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c @@ -70,7 +70,11 @@ dbuf_cons(void *vdb, void *unused, int kmflag) 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); } |