diff --git a/src/bio/bio_xstream.c b/src/bio/bio_xstream.c index 059556ba89a..e72223be2fd 100644 --- a/src/bio/bio_xstream.c +++ b/src/bio/bio_xstream.c @@ -1,7 +1,7 @@ /** * (C) Copyright 2018-2024 Intel Corporation. * (C) Copyright 2025 Google LLC - * (C) Copyright 2025 Hewlett Packard Enterprise Development LP + * (C) Copyright 2025-2026 Hewlett Packard Enterprise Development LP * * SPDX-License-Identifier: BSD-2-Clause-Patent */ @@ -31,8 +31,8 @@ /* These Macros should be turned into DAOS configuration in the future */ #define DAOS_MSG_RING_SZ 4096 -/* SPDK blob parameters */ -#define DAOS_BS_CLUSTER_SZ (1ULL << 25) /* 32MB */ +/* Default cluster size in MB */ +#define DAOS_DEFAULT_CLUSTER_MB 128 /* DMA buffer parameters */ #define DAOS_DMA_CHUNK_INIT_PCT 50 /* Default per-xstream init chunks, in percentage */ #define DAOS_DMA_CHUNK_CNT_MAX 128 /* Default per-xstream max chunks, 1GB */ @@ -224,6 +224,7 @@ bio_nvme_init_ext(const char *nvme_conf, int numa_node, unsigned int mem_size, char *env; int rc, fd; unsigned int size_mb = BIO_DMA_CHUNK_MB, io_timeout_secs = 0; + unsigned int cluster_mb = DAOS_DEFAULT_CLUSTER_MB; if (tgt_nr <= 0) { D_ERROR("tgt_nr: %u should be > 0\n", tgt_nr); @@ -323,8 +324,14 @@ bio_nvme_init_ext(const char *nvme_conf, int numa_node, unsigned int mem_size, D_INFO("Set per-xstream DMA buffer upper bound to %u %uMB chunks, prealloc %u chunks\n", bio_chk_cnt_max, size_mb, init_chk_cnt()); + d_getenv_uint("DAOS_BS_CLUSTER_MB", &cluster_mb); + if (cluster_mb < 32 || cluster_mb > 1024) { + D_WARN("DAOS_BS_CLUSTER_MB %u is invalid, default %u is used\n", cluster_mb, + DAOS_DEFAULT_CLUSTER_MB); + cluster_mb = DAOS_DEFAULT_CLUSTER_MB; + } spdk_bs_opts_init(&nvme_glb.bd_bs_opts, sizeof(nvme_glb.bd_bs_opts)); - nvme_glb.bd_bs_opts.cluster_sz = DAOS_BS_CLUSTER_SZ; + nvme_glb.bd_bs_opts.cluster_sz = (cluster_mb << 20); nvme_glb.bd_bs_opts.max_channel_ops = BIO_BS_MAX_CHANNEL_OPS; d_agetenv_str(&env, "VOS_BDEV_CLASS"); @@ -368,8 +375,9 @@ bio_nvme_init_ext(const char *nvme_conf, int numa_node, unsigned int mem_size, if (!bio_nvme_configured(SMD_DEV_TYPE_META)) nvme_glb.bd_bs_opts.cluster_sz = (1UL << 30); /* 1GB */ - D_INFO("MD on SSD is %s\n", - bio_nvme_configured(SMD_DEV_TYPE_META) ? "enabled" : "disabled"); + D_INFO("MD on SSD is %s, %u cluster size is used\n", + bio_nvme_configured(SMD_DEV_TYPE_META) ? "enabled" : "disabled", + nvme_glb.bd_bs_opts.cluster_sz); bio_spdk_inited = true; diff --git a/src/tests/suite/daos_md_replication.c b/src/tests/suite/daos_md_replication.c index 1c10bae3d4b..a1d1ceb6692 100644 --- a/src/tests/suite/daos_md_replication.c +++ b/src/tests/suite/daos_md_replication.c @@ -1,5 +1,6 @@ /** * (C) Copyright 2017-2022 Intel Corporation. + * (C) Copyright 2026 Hewlett Packard Enterprise Development LP * * SPDX-License-Identifier: BSD-2-Clause-Patent */ @@ -11,6 +12,12 @@ #include #include "daos_test.h" +/* + * Given the 128MB default blobstore cluster size, the minimal pool scm_size for + * an 8 targets engine would be 128MB * 8 = 1GB. + */ +#define MIN_SCM_SIZE (1ULL << 30) + static void mdr_stop_pool_svc(void **argv) { @@ -24,10 +31,8 @@ mdr_stop_pool_svc(void **argv) /* Create the pool. */ if (arg->myrank == 0) { print_message("creating pool\n"); - rc = dmg_pool_create(dmg_config_file, - geteuid(), getegid(), arg->group, - NULL, 256 * 1024 * 1024, 0, - NULL, arg->pool.svc, uuid); + rc = dmg_pool_create(dmg_config_file, geteuid(), getegid(), arg->group, NULL, + MIN_SCM_SIZE, 0, NULL, arg->pool.svc, uuid); } par_bcast(PAR_COMM_WORLD, &rc, 1, PAR_INT, 0); assert_rc_equal(rc, 0); @@ -134,10 +139,8 @@ mdr_stop_cont_svc(void **argv) int rc; print_message("creating pool\n"); - rc = dmg_pool_create(dmg_config_file, - geteuid(), getegid(), arg->group, - NULL, 256 * 1024 * 1024, 0, - NULL, arg->pool.svc, pool_uuid); + rc = dmg_pool_create(dmg_config_file, geteuid(), getegid(), arg->group, NULL, MIN_SCM_SIZE, + 0, NULL, arg->pool.svc, pool_uuid); assert_rc_equal(rc, 0); if (arg->pool.svc->rl_nr < 3) { diff --git a/src/tests/suite/daos_mgmt.c b/src/tests/suite/daos_mgmt.c index 49c520fa53b..6866a8d5376 100644 --- a/src/tests/suite/daos_mgmt.c +++ b/src/tests/suite/daos_mgmt.c @@ -1,6 +1,6 @@ /** * (C) Copyright 2016-2024 Intel Corporation. - * (C) Copyright 2025 Hewlett Packard Enterprise Development LP + * (C) Copyright 2025-2026 Hewlett Packard Enterprise Development LP * * SPDX-License-Identifier: BSD-2-Clause-Patent */ @@ -20,6 +20,12 @@ #include #include +/* + * Given the 128MB default blobstore cluster size, the minimal pool scm_size for + * an 8 targets engine would be 128MB * 8 = 1GB. + */ +#define MIN_SCM_SIZE (1ULL << 30) + /** create/destroy pool on all tgts */ static void pool_create_all(void **state) @@ -36,11 +42,8 @@ pool_create_all(void **state) /** create container */ print_message("creating pool synchronously ... "); - rc = dmg_pool_create(dmg_config_file, - geteuid(), getegid(), - arg->group, NULL /* tgts */, - 256 * 1024 * 1024 /* minimal size */, - 0 /* nvme size */, NULL /* prop */, + rc = dmg_pool_create(dmg_config_file, geteuid(), getegid(), arg->group, NULL /* tgts */, + MIN_SCM_SIZE, 0 /* nvme size */, NULL /* prop */, arg->pool.svc /* svc */, uuid); assert_rc_equal(rc, 0); @@ -341,11 +344,8 @@ pool_create_and_destroy_retry(void **state) test_set_engine_fail_loc(arg, CRT_NO_RANK, DAOS_POOL_CREATE_FAIL_CORPC | DAOS_FAIL_ONCE); print_message("creating pool synchronously ... "); - rc = dmg_pool_create(dmg_config_file, - geteuid(), getegid(), - arg->group, NULL /* tgts */, - 256 * 1024 * 1024 /* minimal size */, - 0 /* nvme size */, NULL /* prop */, + rc = dmg_pool_create(dmg_config_file, geteuid(), getegid(), arg->group, NULL /* tgts */, + MIN_SCM_SIZE, 0 /* nvme size */, NULL /* prop */, arg->pool.svc /* svc */, uuid); assert_rc_equal(rc, 0); print_message("success uuid = "DF_UUIDF"\n", DP_UUID(uuid)); @@ -435,8 +435,7 @@ pool_create_steps_down_from_up_empty(void **state) svc.rl_ranks = &rank; svc.rl_nr = 1; rc = dmg_pool_create(dmg_config_file, geteuid(), getegid(), arg->group, NULL /* tgts */, - 256 * 1024 * 1024 /* minimal size */, 0 /* nvme size */, - NULL /* prop */, &svc, uuid); + MIN_SCM_SIZE, 0 /* nvme size */, NULL /* prop */, &svc, uuid); assert_rc_equal(rc, 0); print_message("success uuid = "DF_UUIDF"\n", DP_UUID(uuid)); @@ -466,8 +465,7 @@ pool_destroy_disconnect_all(void **state) print_message("creating pool synchronously ... "); rc = dmg_pool_create(dmg_config_file, geteuid(), getegid(), arg->group, NULL /* tgts */, - 256 * 1024 * 1024 /* minimal size */, 0 /* nvme size */, - NULL /* prop */, arg->pool.svc, uuid); + MIN_SCM_SIZE, 0 /* nvme size */, NULL /* prop */, arg->pool.svc, uuid); assert_rc_equal(rc, 0); print_message("success uuid = "DF_UUIDF"\n", DP_UUID(uuid)); @@ -515,8 +513,7 @@ pool_destroy_cancel_rfcheck(void **state) print_message("creating pool synchronously ... "); rc = dmg_pool_create(dmg_config_file, geteuid(), getegid(), arg->group, NULL /* tgts */, - 256 * 1024 * 1024 /* minimal size */, 0 /* nvme size */, - NULL /* prop */, arg->pool.svc, uuid); + MIN_SCM_SIZE, 0 /* nvme size */, NULL /* prop */, arg->pool.svc, uuid); assert_rc_equal(rc, 0); print_message("success uuid = "DF_UUIDF"\n", DP_UUID(uuid)); @@ -544,8 +541,7 @@ pool_create_query_fail(void **state) print_message("creating pool synchronously ... "); rc = dmg_pool_create(dmg_config_file, geteuid(), getegid(), arg->group, NULL /* tgts */, - 256 * 1024 * 1024 /* minimal size */, 0 /* nvme size */, - NULL /* prop */, arg->pool.svc, uuid); + MIN_SCM_SIZE, 0 /* nvme size */, NULL /* prop */, arg->pool.svc, uuid); assert_rc_equal(rc, 0); print_message("success uuid = " DF_UUIDF "\n", DP_UUID(uuid)); diff --git a/src/vos/tests/wal_ut.c b/src/vos/tests/wal_ut.c index 32b4b4c9957..0bdc85a38d7 100644 --- a/src/vos/tests/wal_ut.c +++ b/src/vos/tests/wal_ut.c @@ -1,5 +1,6 @@ /** * (C) Copyright 2023-2024 Intel Corporation. + * (C) Copyright 2026 Hewlett Packard Enterprise Development LP * * SPDX-License-Identifier: BSD-2-Clause-Patent */ @@ -669,8 +670,8 @@ ut_fill_wal(struct bio_ut_args *args, int tx_nr, struct ut_tx_array **txa_ptr) tx = txa->ta_tx_ptrs[0]; /* - * Each tx is roughly 800k, 40 txs will consume 32000k, which is more than - * half of 50MB WAL size. + * Each tx is roughly 800k, 100 txs will consume 80MB, which is more than + * half of 128MB WAL size. */ for (i = 0; i < tx_nr; i++) { tx = txa->ta_tx_ptrs[i]; @@ -705,11 +706,11 @@ static void wal_ut_wrap(void **state) { struct bio_ut_args *args = *state; - uint64_t meta_sz = (50ULL << 20); /* 50 MB */ + uint64_t meta_sz = (128ULL << 20); /* 128 MB */ struct ut_tx_array *txa; struct umem_wal_tx *tx; struct ut_fake_tx *fake_tx; - int tx_nr = 40, rc; + int tx_nr = 100, rc; rc = ut_mc_init(args, meta_sz, meta_sz, meta_sz); assert_rc_equal(rc, 0); @@ -745,11 +746,11 @@ static void wal_ut_wrap_many(void **state) { struct bio_ut_args *args = *state; - uint64_t meta_sz = (50ULL << 20); /* 50 MB */ + uint64_t meta_sz = (128ULL << 20); /* 128 MB */ struct ut_tx_array *txa; struct umem_wal_tx *tx; struct ut_fake_tx *fake_tx; - int tx_nr = 40, rc; + int tx_nr = 100, rc; rc = ut_mc_init(args, meta_sz, meta_sz, meta_sz); assert_rc_equal(rc, 0);