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-14788 container: refine task process in pmap_refresh_cb #13491

Merged
merged 2 commits into from
Dec 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
17 changes: 9 additions & 8 deletions src/container/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,14 +668,6 @@ pmap_refresh_cb(tse_task_t *task, void *data)
else
delay = 0;

rc = tse_task_reinit_with_delay(task, delay);
if (rc) {
D_ERROR(DF_UUID": pmap_refresh version (%d:%d), resched"
" failed, "DF_RC"\n", DP_UUID(pool->dp_pool),
pm_ver, cb_arg->pra_pm_ver, DP_RC(rc));
goto out;
}

rc = tse_task_register_comp_cb(task, pmap_refresh_cb, cb_arg,
sizeof(*cb_arg));
if (rc) {
Expand All @@ -690,6 +682,15 @@ pmap_refresh_cb(tse_task_t *task, void *data)
D_DEBUG(DB_TRACE, DF_UUID": pmap_refresh version (%d:%d), "
"in %d retry\n", DP_UUID(pool->dp_pool), pm_ver,
cb_arg->pra_pm_ver, cb_arg->pra_retry_nr);

rc = tse_task_reinit_with_delay(task, delay);
if (rc) {
D_ERROR(DF_UUID": pmap_refresh version (%d:%d), resched"
" failed, "DF_RC"\n", DP_UUID(pool->dp_pool),
pm_ver, cb_arg->pra_pm_ver, DP_RC(rc));
goto out;
}

return rc;
}
out:
Expand Down
9 changes: 5 additions & 4 deletions src/include/daos/tse.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,11 @@ tse_task_register_cbs(tse_task_t *task, tse_task_cb_t prep_cb,

/**
* Reinitialize a task and move it into the scheduler's initialize list. The
* task must have a body function to be reinserted into the scheduler. If the
* task is reintialzed in one of its completion CBs, that callback and the ones
* that have already executed will have been removed from the cb list and will
* need to be re-registered by the user after re-insertion.
* task must have a body function to be reinserted into the scheduler.
* Once the task being reinitialized, it possible be executed by other thread
* when it progresses the scheduler. So all accesses to the task must happen before
* the reinit call, for example task dependency/callback registration or task
* argument accessing.
*
* \param task [IN] Task to reinitialize
*
Expand Down