Author: mav
Date: Tue Jul 31 00:47:27 2018
New Revision: 336956
URL: https://svnweb.freebsd.org/changeset/base/336956

Log:
  MFV r336955: 9236 nuke spa_dbgmsg
  
  We should use zfs_dbgmsg instead of spa_dbgmsg.  Or at least,
  metaslab_condense() should call zfs_dbgmsg because it's important and rare
  enough to always log. It's possible that the message in zio_dva_allocate()
  would be too high-frequency for zfs_dbgmsg.
  
  illumos/illumos-gate@21f7c81cc1156e9202ce3412d3ecaa697c3b2222
  
  Reviewed by: Serapheim Dimitropoulos <serapheim.dimi...@delphix.com>
  Reviewed by: Pavel Zakharov <pavel.zakha...@delphix.com>
  Reviewed by: George Wilson <george.wil...@delphix.com>
  Reviewed by: Richard Elling <richard.ell...@richardelling.com>
  Approved by: Richard Lowe <richl...@richlowe.net>
  Author: Matthew Ahrens <mahr...@delphix.com>

Modified:
  head/cddl/contrib/opensolaris/cmd/ztest/ztest.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c     Tue Jul 31 00:42:31 
2018        (r336955)
+++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c     Tue Jul 31 00:47:27 
2018        (r336956)
@@ -20,7 +20,7 @@
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, 2016 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2017 by Delphix. All rights reserved.
  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  * Copyright (c) 2012 Martin Matuska <m...@freebsd.org>.  All rights reserved.
  * Copyright (c) 2013 Steven Hartland. All rights reserved.
@@ -5921,7 +5921,6 @@ ztest_run(ztest_shared_t *zs)
         */
        kernel_init(FREAD | FWRITE);
        VERIFY0(spa_open(ztest_opts.zo_pool, &spa, FTAG));
-       spa->spa_debug = B_TRUE;
        metaslab_preload_limit = ztest_random(20) + 1;
        ztest_spa = spa;
 
@@ -6078,7 +6077,6 @@ ztest_freeze(void)
        kernel_init(FREAD | FWRITE);
        VERIFY3U(0, ==, spa_open(ztest_opts.zo_pool, &spa, FTAG));
        VERIFY3U(0, ==, ztest_dataset_open(0));
-       spa->spa_debug = B_TRUE;
        ztest_spa = spa;
 
        /*
@@ -6149,7 +6147,6 @@ ztest_freeze(void)
        VERIFY3U(0, ==, ztest_dataset_open(0));
        ztest_dataset_close(0);
 
-       spa->spa_debug = B_TRUE;
        ztest_spa = spa;
        txg_wait_synced(spa_get_dsl(spa), 0);
        ztest_reguid(NULL, 0);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c      Tue Jul 
31 00:42:31 2018        (r336955)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c      Tue Jul 
31 00:47:27 2018        (r336956)
@@ -1747,7 +1747,7 @@ metaslab_set_fragmentation(metaslab_t *msp)
                if (spa_writeable(spa) && txg < spa_final_dirty_txg(spa)) {
                        msp->ms_condense_wanted = B_TRUE;
                        vdev_dirty(vd, VDD_METASLAB, msp, txg + 1);
-                       spa_dbgmsg(spa, "txg %llu, requesting force condense: "
+                       zfs_dbgmsg("txg %llu, requesting force condense: "
                            "ms_id %llu, vdev_id %llu", txg, msp->ms_id,
                            vd->vdev_id);
                }

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c      Tue Jul 
31 00:42:31 2018        (r336955)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c      Tue Jul 
31 00:47:27 2018        (r336956)
@@ -252,7 +252,7 @@ int spa_mode_global;
  * Everything except dprintf, spa, and indirect_remap is on by default
  * in debug builds.
  */
-int zfs_flags = ~(ZFS_DEBUG_DPRINTF | ZFS_DEBUG_SPA | 
ZFS_DEBUG_INDIRECT_REMAP);
+int zfs_flags = ~(ZFS_DEBUG_DPRINTF | ZFS_DEBUG_INDIRECT_REMAP);
 #else
 int zfs_flags = 0;
 #endif
@@ -821,8 +821,6 @@ spa_add(const char *name, nvlist_t *config, const char
                    KM_SLEEP) == 0);
        }
 
-       spa->spa_debug = ((zfs_flags & ZFS_DEBUG_SPA) != 0);
-
        spa->spa_min_ashift = INT_MAX;
        spa->spa_max_ashift = 0;
 
@@ -2278,12 +2276,6 @@ spa_scan_get_stats(spa_t *spa, pool_scan_stat_t *ps)
        ps->pss_pass_scrub_spent_paused = spa->spa_scan_pass_scrub_spent_paused;
 
        return (0);
-}
-
-boolean_t
-spa_debug_enabled(spa_t *spa)
-{
-       return (spa->spa_debug);
 }
 
 int

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h       Tue Jul 
31 00:42:31 2018        (r336955)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h       Tue Jul 
31 00:47:27 2018        (r336956)
@@ -947,13 +947,6 @@ _NOTE(CONSTCOND) } while (0)
 #define        dprintf_bp(bp, fmt, ...)
 #endif
 
-extern boolean_t spa_debug_enabled(spa_t *spa);
-#define        spa_dbgmsg(spa, ...)                    \
-{                                              \
-       if (spa_debug_enabled(spa))             \
-               zfs_dbgmsg(__VA_ARGS__);        \
-}
-
 extern int spa_mode_global;                    /* mode, e.g. FREAD | FWRITE */
 
 #ifdef __cplusplus

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h  Tue Jul 
31 00:42:31 2018        (r336955)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h  Tue Jul 
31 00:47:27 2018        (r336956)
@@ -332,7 +332,6 @@ struct spa {
        kcondvar_t      spa_suspend_cv;         /* notification of resume */
        uint8_t         spa_suspended;          /* pool is suspended */
        uint8_t         spa_claiming;           /* pool is doing zil_claim() */
-       boolean_t       spa_debug;              /* debug enabled? */
        boolean_t       spa_is_root;            /* pool is root */
        int             spa_minref;             /* num refs when first opened */
        int             spa_mode;               /* FREAD | FWRITE */

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Tue Jul 
31 00:42:31 2018        (r336955)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Tue Jul 
31 00:47:27 2018        (r336956)
@@ -20,7 +20,7 @@
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2016 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2017 by Delphix. All rights reserved.
  */
 
 #ifndef _SYS_ZFS_DEBUG_H
@@ -57,7 +57,7 @@ extern boolean_t zfs_free_leak_on_eio;
 #define        ZFS_DEBUG_DNODE_VERIFY          (1 << 2)
 #define        ZFS_DEBUG_SNAPNAMES             (1 << 3)
 #define        ZFS_DEBUG_MODIFY                (1 << 4)
-#define        ZFS_DEBUG_SPA                   (1 << 5)
+/* 1<<5 was previously used, try not to reuse */
 #define        ZFS_DEBUG_ZIO_FREE              (1 << 6)
 #define        ZFS_DEBUG_HISTOGRAM_VERIFY      (1 << 7)
 #define        ZFS_DEBUG_METASLAB_VERIFY       (1 << 8)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c   Tue Jul 31 
00:42:31 2018        (r336955)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c   Tue Jul 31 
00:47:27 2018        (r336956)
@@ -3037,7 +3037,7 @@ zio_dva_allocate(zio_t *zio)
            &zio->io_alloc_list, zio, zio->io_allocator);
 
        if (error != 0) {
-               spa_dbgmsg(spa, "%s: metaslab allocation failure: zio %p, "
+               zfs_dbgmsg("%s: metaslab allocation failure: zio %p, "
                    "size %llu, error %d", spa_name(spa), zio, zio->io_size,
                    error);
                if (error == ENOSPC && zio->io_size > SPA_MINBLOCKSIZE)
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to