summaryrefslogtreecommitdiffstats
path: root/module/zfs/metaslab.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2013-03-18 13:03:09 -0700
committerBrian Behlendorf <[email protected]>2013-03-18 16:47:43 -0700
commit30b92c1de68ced4bee235f879791ee316314a197 (patch)
treef3a9e2cfafd2f9682c7e9f3b0a3015f6ca62c310 /module/zfs/metaslab.c
parentf3757573a677e8662e268f0bb8e5ffe750013088 (diff)
Add metaslab_debug option
Enabling metaslab debugging will prevent space maps from being automatically unloaded. This can significantly increase the memory footprint but being able to dynamically control this is helpful for debugging and certain performance testing. Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'module/zfs/metaslab.c')
-rw-r--r--module/zfs/metaslab.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/module/zfs/metaslab.c b/module/zfs/metaslab.c
index d199921b7..03d5a1d9c 100644
--- a/module/zfs/metaslab.c
+++ b/module/zfs/metaslab.c
@@ -58,7 +58,7 @@ int zfs_mg_alloc_failures;
/*
* Metaslab debugging: when set, keeps all space maps in core to verify frees.
*/
-static int metaslab_debug = 0;
+int metaslab_debug = 0;
/*
* Minimum size which forces the dynamic allocator to change
@@ -1746,3 +1746,8 @@ void metaslab_fastwrite_unmark(spa_t *spa, const blkptr_t *bp)
spa_config_exit(spa, SCL_VDEV, FTAG);
}
+
+#if defined(_KERNEL) && defined(HAVE_SPL)
+module_param(metaslab_debug, int, 0644);
+MODULE_PARM_DESC(metaslab_debug, "keep space maps in core to verify frees");
+#endif /* _KERNEL && HAVE_SPL */