From 89da9ae251558dd50a539d15a46f80de1d300f07 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sat, 12 Oct 2024 20:52:27 +0200 Subject: [PATCH] device_mapper: increase mem pool chunk size Use bigger memory pool chunk size and reduces amount of memory pool extensions when handling larger metadata, but do not make it noticable bigger when handling small ones... Use same large value also when allocating VG memory pool. --- device_mapper/libdm-config.c | 2 +- lib/metadata/metadata.h | 2 +- libdm/libdm-config.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/device_mapper/libdm-config.c b/device_mapper/libdm-config.c index 9944f47ab..9716ebd81 100644 --- a/device_mapper/libdm-config.c +++ b/device_mapper/libdm-config.c @@ -102,7 +102,7 @@ static int _tok_match(const char *str, const char *b, const char *e) struct dm_config_tree *dm_config_create(void) { struct dm_config_tree *cft; - struct dm_pool *mem = dm_pool_create("config", 10 * 1024); + struct dm_pool *mem = dm_pool_create("config", 63 * 1024); if (!mem) { log_error("Failed to allocate config pool."); diff --git a/lib/metadata/metadata.h b/lib/metadata/metadata.h index 051d95fac..e868c95b4 100644 --- a/lib/metadata/metadata.h +++ b/lib/metadata/metadata.h @@ -35,7 +35,7 @@ #define MIN_PE_SIZE (8192L >> SECTOR_SHIFT) /* 8 KB in sectors - format1 only */ #define MAX_PE_SIZE (16L * 1024L * (1024L >> SECTOR_SHIFT) * 1024L) /* format1 only */ #define MIRROR_LOG_OFFSET 2 /* sectors */ -#define VG_MEMPOOL_CHUNK 10240 /* in bytes, hint only */ +#define VG_MEMPOOL_CHUNK 63000 /* in bytes, hint only */ /* * Ceiling(n / sz) diff --git a/libdm/libdm-config.c b/libdm/libdm-config.c index 6ba4f733b..04be3af36 100644 --- a/libdm/libdm-config.c +++ b/libdm/libdm-config.c @@ -102,7 +102,7 @@ static int _tok_match(const char *str, const char *b, const char *e) struct dm_config_tree *dm_config_create(void) { struct dm_config_tree *cft; - struct dm_pool *mem = dm_pool_create("config", 10 * 1024); + struct dm_pool *mem = dm_pool_create("config", 63 * 1024); if (!mem) { log_error("Failed to allocate config pool.");