Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAOS-17000 cart: add cio_progress_busy cart init option #15795

Closed
wants to merge 1 commit into from
Closed
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
3 changes: 3 additions & 0 deletions src/cart/README.env
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,6 @@ This file lists the environment variables used in CaRT.
traffic congestion. Available options are: "unspec" (default), "best_effort",
"low_latency", "bulk_data".

D_PROGRESS_BUSY
Force busy polling when progressing, preventing from sleeping when waiting for
new messages.
2 changes: 1 addition & 1 deletion src/cart/crt_hg.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright 2016-2024 Intel Corporation.

Check failure on line 2 in src/cart/crt_hg.c

View workflow job for this annotation

GitHub Actions / Copyright check

Copyright out of date
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -843,7 +843,7 @@

init_info.na_init_info.auth_key = prov_data->cpg_na_config.noc_auth_key;

if (crt_provider_is_block_mode(provider))
if (crt_provider_is_block_mode(provider) && !prov_data->cpg_progress_busy)
init_info.na_init_info.progress_mode = 0;
else
init_info.na_init_info.progress_mode = NA_NO_BLOCK;
Expand Down
8 changes: 8 additions & 0 deletions src/cart/crt_init.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright 2016-2024 Intel Corporation.

Check failure on line 2 in src/cart/crt_init.c

View workflow job for this annotation

GitHub Actions / Copyright check

Copyright out of date
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -198,6 +198,14 @@
prov_data->cpg_max_unexp_size = max_unexpect_size;
prov_data->cpg_primary = primary;

if (opt && opt->cio_progress_busy) {
prov_data->cpg_progress_busy = opt->cio_progress_busy;
} else {
bool progress_busy = false;
crt_env_get(D_PROGRESS_BUSY, &progress_busy);
prov_data->cpg_progress_busy = progress_busy;
}

for (i = 0; i < CRT_SRV_CONTEXT_NUM; i++)
prov_data->cpg_used_idx[i] = false;

Expand Down
35 changes: 19 additions & 16 deletions src/cart/crt_internal_types.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright 2016-2024 Intel Corporation.

Check failure on line 2 in src/cart/crt_internal_types.h

View workflow job for this annotation

GitHub Actions / Copyright check

Copyright out of date
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -55,38 +55,40 @@

struct crt_prov_gdata {
/** NA plugin type */
int cpg_provider;
int cpg_provider;

struct crt_na_config cpg_na_config;
struct crt_na_config cpg_na_config;
/** Context0 URI */
char cpg_addr[CRT_ADDR_STR_MAX_LEN];
char cpg_addr[CRT_ADDR_STR_MAX_LEN];

/** CaRT contexts list */
d_list_t cpg_ctx_list;
d_list_t cpg_ctx_list;
/** actual number of items in CaRT contexts list */
int cpg_ctx_num;
int cpg_ctx_num;
/** maximum number of contexts user wants to create */
uint32_t cpg_ctx_max_num;
uint32_t cpg_ctx_max_num;

/** free-list of indices */
bool cpg_used_idx[CRT_SRV_CONTEXT_NUM];
bool cpg_used_idx[CRT_SRV_CONTEXT_NUM];

/** Hints to mercury/ofi for max expected/unexp sizes */
uint32_t cpg_max_exp_size;
uint32_t cpg_max_unexp_size;
uint32_t cpg_max_exp_size;
uint32_t cpg_max_unexp_size;

/** Number of remote tags */
uint32_t cpg_num_remote_tags;
uint32_t cpg_last_remote_tag;
uint32_t cpg_num_remote_tags;
uint32_t cpg_last_remote_tag;

/** Set of flags */
unsigned int cpg_sep_mode : 1,
cpg_primary : 1,
cpg_contig_ports : 1,
cpg_inited : 1;
unsigned int cpg_sep_mode : 1;
unsigned int cpg_primary : 1;
unsigned int cpg_contig_ports : 1;
unsigned int cpg_inited : 1;

bool cpg_progress_busy;
soumagne marked this conversation as resolved.
Show resolved Hide resolved

/** Mutext to protect fields above */
pthread_mutex_t cpg_mutex;
pthread_mutex_t cpg_mutex;
};

#define MAX_NUM_SECONDARY_PROVS 2
Expand Down Expand Up @@ -226,6 +228,7 @@
ENV_STR(D_PORT) \
ENV(D_PORT_AUTO_ADJUST) \
ENV(D_THREAD_MODE_SINGLE) \
ENV(D_PROGRESS_BUSY) \
ENV(D_POST_INCR) \
ENV(D_POST_INIT) \
ENV(D_MRECV_BUF) \
Expand Down
4 changes: 4 additions & 0 deletions src/include/cart/types.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright 2016-2024 Intel Corporation.

Check failure on line 2 in src/include/cart/types.h

View workflow job for this annotation

GitHub Actions / Copyright check

Copyright out of date
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -60,6 +60,7 @@
/** whether or not to use expected sizes */
cio_use_expected_size:1,
cio_use_unexpected_size:1;

/** overrides the value of the environment variable CRT_CTX_NUM */
int cio_ctx_max_num;

Expand Down Expand Up @@ -94,6 +95,9 @@

/** use single thread to access context */
bool cio_thread_mode_single;

/** force busy wait (testing only, not in production) */
bool cio_progress_busy;
} crt_init_options_t;

typedef int crt_status_t;
Expand Down
Loading