]> granicus.if.org Git - zfs/commitdiff
OpenZFS 7545 - zdb should disable reference tracking
authorGiuseppe Di Natale <dinatale2@users.noreply.github.com>
Tue, 31 Jan 2017 22:36:35 +0000 (14:36 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 31 Jan 2017 22:36:35 +0000 (14:36 -0800)
Authored by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Ported-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Porting Notes: Moved reference_tracking_enable and
reference_history outside of ZFS_DEBUG.

OpenZFS-issue: https://www.illumos.org/issues/7545
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/4dd77f9
Closes #5701

cmd/zdb/zdb.c
module/zfs/refcount.c

index 10bca4a91987a9ff98708a556588e167d7bc35a0..cc4b0340f764d4efdc5f4e43162b8cd26fcc9de6 100644 (file)
@@ -84,10 +84,12 @@ zdb_ot_name(dmu_object_type_t type)
 }
 
 #ifndef lint
+extern int reference_tracking_enable;
 extern int zfs_recover;
 extern uint64_t zfs_arc_max, zfs_arc_meta_limit;
 extern int zfs_vdev_async_read_max_active;
 #else
+int reference_tracking_enable;
 int zfs_recover;
 uint64_t zfs_arc_max, zfs_arc_meta_limit;
 int zfs_vdev_async_read_max_active;
@@ -3813,6 +3815,11 @@ main(int argc, char **argv)
         */
        zfs_vdev_async_read_max_active = 10;
 
+       /*
+        * Disable reference tracking for better performance.
+        */
+       reference_tracking_enable = B_FALSE;
+
        kernel_init(FREAD);
        if ((g_zfs = libzfs_init()) == NULL) {
                (void) fprintf(stderr, "%s", libzfs_error_init(errno));
index 6f8f4db0891f06bad9c2703a19cf32629b52f01d..b33874714dc15279a6c2e72d17447c2267863a9b 100644 (file)
@@ -26,8 +26,6 @@
 #include <sys/zfs_context.h>
 #include <sys/refcount.h>
 
-#ifdef ZFS_DEBUG
-
 #ifdef _KERNEL
 int reference_tracking_enable = FALSE; /* runs out of memory too easily */
 #else
@@ -35,6 +33,7 @@ int reference_tracking_enable = TRUE;
 #endif
 int reference_history = 3; /* tunable */
 
+#ifdef ZFS_DEBUG
 static kmem_cache_t *reference_cache;
 static kmem_cache_t *reference_history_cache;