Skip to content

Commit

Permalink
DAOS-16866 bio: prealloc less DMA buffer for sys tgt (#15674)
Browse files Browse the repository at this point in the history
Sys target needs only very limited DMA buffer for the WAL of RDB,
we can prealloc only 1 chunk for sys target so that leave more
hugepages for regular VOS targets.

Reduced the pre-allocate hugepages from 60% to 50% on start.

Signed-off-by: Niu Yawei <[email protected]>
  • Loading branch information
NiuYawei authored Jan 13, 2025
1 parent 6dda9d7 commit 23518fa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/bio/bio_xstream.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* (C) Copyright 2018-2024 Intel Corporation.
* (C) Copyright 2025 Hewlett Packard Enterprise Development LP
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -31,7 +32,7 @@
/* SPDK blob parameters */
#define DAOS_BS_CLUSTER_SZ (1ULL << 25) /* 32MB */
/* DMA buffer parameters */
#define DAOS_DMA_CHUNK_INIT_PCT 60 /* Default pre-xstream init chunks, in percentage */
#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 */
#define DAOS_DMA_CHUNK_CNT_MIN 32 /* Per-xstream min chunks, 256MB */

Expand Down Expand Up @@ -1686,7 +1687,9 @@ bio_xsctxt_alloc(struct bio_xs_context **pctxt, int tgt_id, bool self_polling)
D_ASSERT(d_bdev != NULL);
}

ctxt->bxc_dma_buf = dma_buffer_create(init_chk_cnt(), tgt_id);
/* Sys target only needs very limited DMA buffer for the WAL of RDB */
ctxt->bxc_dma_buf = dma_buffer_create(tgt_id == BIO_SYS_TGT_ID ? 1 : init_chk_cnt(),
tgt_id);
if (ctxt->bxc_dma_buf == NULL) {
D_ERROR("failed to initialize dma buffer\n");
rc = -DER_NOMEM;
Expand Down

0 comments on commit 23518fa

Please sign in to comment.