From d2233a08fa872f9a3af0c84697c0366bb85eea5e Mon Sep 17 00:00:00 2001 From: Matthew Macy Date: Mon, 9 Dec 2019 12:29:56 -0800 Subject: [PATCH] Exclude data from cores unconditionally and metadata conditionally This change allows us to align the code dump logic across platforms. Reviewed-by: Jorgen Lundman Reviewed-by: Brian Behlendorf Reviewed-by: Don Brady Signed-off-by: Matt Macy Closes #9691 --- include/sys/zio.h | 1 + module/zfs/zio.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/include/sys/zio.h b/include/sys/zio.h index e69bf9208..aa58fe1fa 100644 --- a/include/sys/zio.h +++ b/include/sys/zio.h @@ -278,6 +278,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 aac0392a4..1bd9f2e90 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); } }