aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Macy <[email protected]>2019-12-09 12:29:56 -0800
committerBrian Behlendorf <[email protected]>2019-12-09 12:29:56 -0800
commit3c502d3b75a092dbfeacce9e1a93a985bedbbb2a (patch)
treec3648e8cec231132a140bc7184ad9e2983903ab0
parentea79e90f995e53357f68885fda03ea10713ef08d (diff)
Exclude data from cores unconditionally and metadata conditionally
This change allows us to align the code dump logic across platforms. Reviewed-by: Jorgen Lundman <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Don Brady <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #9691
-rw-r--r--include/sys/zio.h1
-rw-r--r--module/zfs/zio.c13
2 files changed, 12 insertions, 2 deletions
diff --git a/include/sys/zio.h b/include/sys/zio.h
index 3ecaced74..46f90a062 100644
--- a/include/sys/zio.h
+++ b/include/sys/zio.h
@@ -269,6 +269,7 @@ enum zio_wait_type {
typedef void zio_done_func_t(zio_t *zio);
+extern int zio_exclude_metadata;
extern int zio_dva_throttle_enabled;
extern const char *zio_type_name[ZIO_TYPES];
diff --git a/module/zfs/zio.c b/module/zfs/zio.c
index 4ec4bb691..c0b93346d 100644
--- a/module/zfs/zio.c
+++ b/module/zfs/zio.c
@@ -121,6 +121,11 @@ int zfs_sync_pass_rewrite = 2; /* rewrite new bps starting in this pass */
*/
#define IO_IS_ALLOCATING(zio) ((zio)->io_orig_pipeline & ZIO_STAGE_DVA_ALLOCATE)
+/*
+ * Enable smaller cores by excluding metadata
+ * allocations as well.
+ */
+int zio_exclude_metadata = 0;
int zio_requeue_io_start_cut_in_line = 1;
#ifdef ZFS_DEBUG
@@ -153,7 +158,11 @@ zio_init(void)
size_t size = (c + 1) << SPA_MINBLOCKSHIFT;
size_t p2 = size;
size_t align = 0;
- size_t cflags = (size > zio_buf_debug_limit) ? KMC_NODEBUG : 0;
+ size_t data_cflags, cflags;
+
+ data_cflags = KMC_NODEBUG;
+ cflags = (zio_exclude_metadata || size > zio_buf_debug_limit) ?
+ KMC_NODEBUG : 0;
#if defined(_ILP32) && defined(_KERNEL)
/*
@@ -201,7 +210,7 @@ zio_init(void)
(void) sprintf(name, "zio_data_buf_%lu", (ulong_t)size);
zio_data_buf_cache[c] = kmem_cache_create(name, size,
align, NULL, NULL, NULL, NULL,
- data_alloc_arena, cflags);
+ data_alloc_arena, data_cflags);
}
}