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-8781 client: allow polling timeout to be modified via env #12124

Merged
merged 2 commits into from
Jun 15, 2023
Merged
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
1 change: 1 addition & 0 deletions docs/admin/env_variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ Environment variables in this section only apply to the client side.
|Variable |Description|
|-------------------------|-----------|
|FI\_MR\_CACHE\_MAX\_COUNT|Enable MR (Memory Registration) caching in OFI layer. Recommended to be set to 0 (disable) when CRT\_DISABLE\_MEM\_PIN is NOT set to 1. INTEGER. Default to unset.|
|D\_POLL\_TIMEOUT|Polling timeout passed to network progress for synchronous operations. Default to 0 (busy polling), value in micro-seconds otherwise.|


## Debug System (Client & Server)
Expand Down
3 changes: 2 additions & 1 deletion src/cart/crt_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ dump_envariables(void)
"CRT_CTX_SHARE_ADDR", "CRT_CTX_NUM", "D_FI_CONFIG",
"FI_UNIVERSE_SIZE", "CRT_ENABLE_MEM_PIN",
"FI_OFI_RXM_USE_SRX", "D_LOG_FLUSH", "CRT_MRC_ENABLE",
"CRT_SECONDARY_PROVIDER", "D_PROVIDER_AUTH_KEY", "D_PORT_AUTO_ADJUST"};
"CRT_SECONDARY_PROVIDER", "D_PROVIDER_AUTH_KEY", "D_PORT_AUTO_ADJUST",
"D_POOL_TIMEOUT"};

D_INFO("-- ENVARS: --\n");
for (i = 0; i < ARRAY_SIZE(envars); i++) {
Expand Down
10 changes: 9 additions & 1 deletion src/client/api/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
static __thread daos_event_t ev_thpriv;
static __thread bool ev_thpriv_is_init;

/**
* Global progress timeout for synchronous operation
* busy-polling by default (0), timeout in us otherwise
*/
static uint32_t ev_prog_timeout;

#define EQ_WITH_CRT

#if !defined(EQ_WITH_CRT)
Expand Down Expand Up @@ -91,6 +97,8 @@ daos_eq_lib_init()

eq_ref = 1;

d_getenv_int("D_POLL_TIMEOUT", &ev_prog_timeout);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for new cart envs we document them in src/cart/README.env - is there a similar place for DAOS level envars where this needs to be added?

There is also
62 dump_envariables(void) {}
call in crt_init.c where new envar might want to be added for debug purposes


unlock:
D_MUTEX_UNLOCK(&daos_eq_lock);
return rc;
Expand Down Expand Up @@ -1262,7 +1270,7 @@ daos_event_priv_wait()

/* Wait on the event to complete */
while (evx->evx_status != DAOS_EVS_READY) {
rc = crt_progress_cond(evx->evx_ctx, 0, ev_progress_cb, &epa);
rc = crt_progress_cond(evx->evx_ctx, ev_prog_timeout, ev_progress_cb, &epa);

/** progress succeeded, loop can exit if event completed */
if (rc == 0) {
Expand Down