Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions src/bio/bio_xstream.c
Original file line number Diff line number Diff line change
@@ -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
*/
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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;

Expand Down
19 changes: 11 additions & 8 deletions src/tests/suite/daos_md_replication.c
Original file line number Diff line number Diff line change
@@ -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
*/
Expand All @@ -11,6 +12,12 @@
#include <daos/pool.h>
#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)
{
Expand All @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down
34 changes: 15 additions & 19 deletions src/tests/suite/daos_mgmt.c
Original file line number Diff line number Diff line change
@@ -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
*/
Expand All @@ -20,6 +20,12 @@
#include <daos_event.h>
#include <daos/agent.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)

/** create/destroy pool on all tgts */
static void
pool_create_all(void **state)
Expand All @@ -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);

Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));

Expand Down Expand Up @@ -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));

Expand Down Expand Up @@ -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));

Expand Down Expand Up @@ -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));

Expand Down
13 changes: 7 additions & 6 deletions src/vos/tests/wal_ut.c
Original file line number Diff line number Diff line change
@@ -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
*/
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
Loading