-
Notifications
You must be signed in to change notification settings - Fork 424
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
UCS/UCP/RCACHE: Store memh completion in request #10190
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,10 +54,11 @@ enum { | |
UCP_REQUEST_FLAG_RKEY_INUSE = UCS_BIT(18), | ||
UCP_REQUEST_FLAG_USER_HEADER_COPIED = UCS_BIT(19), | ||
UCP_REQUEST_FLAG_USAGE_TRACKED = UCS_BIT(20), | ||
UCP_REQUEST_FLAG_INVALIDATED = UCS_BIT(21), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this PR it's used only within This flag indicates invalidated request (not just memory handle), meaning the request which populated There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I will add code to this PR that actually uses this flag in production code path |
||
#if UCS_ENABLE_ASSERT | ||
UCP_REQUEST_FLAG_STREAM_RECV = UCS_BIT(21), | ||
UCP_REQUEST_DEBUG_FLAG_EXTERNAL = UCS_BIT(22), | ||
UCP_REQUEST_FLAG_SUPER_VALID = UCS_BIT(23), | ||
UCP_REQUEST_FLAG_STREAM_RECV = UCS_BIT(22), | ||
UCP_REQUEST_DEBUG_FLAG_EXTERNAL = UCS_BIT(23), | ||
UCP_REQUEST_FLAG_SUPER_VALID = UCS_BIT(24), | ||
#else | ||
UCP_REQUEST_FLAG_STREAM_RECV = 0, | ||
UCP_REQUEST_DEBUG_FLAG_EXTERNAL = 0, | ||
|
@@ -333,7 +334,8 @@ struct ucp_request { | |
} flush; | ||
|
||
struct { | ||
ucp_worker_h worker; | ||
ucp_worker_h worker; | ||
ucs_rcache_comp_entry_t comp; | ||
} invalidate; | ||
|
||
struct { | ||
|
@@ -536,14 +538,21 @@ void ucp_request_memory_dereg(ucp_datatype_t datatype, ucp_dt_state_t *state, | |
ucp_request_t *req); | ||
|
||
/** | ||
* @brief Invalidates the request associated memh if required. | ||
* @brief Detects whether request memh can be invalidated | ||
* | ||
* @param [in] req Request that contains memh | ||
* @param [in] status Status of the error which caused abortion | ||
* | ||
* @return 1 if invalidation happened, 0 if invalidation isn't required/supported | ||
* @return 1 if invalidation supported, 0 if invalidation isn't required/supported | ||
*/ | ||
int ucp_request_memh_check_invalidate(ucp_request_t *req); | ||
|
||
/** | ||
* @brief Invalidates the request associated memh. | ||
* | ||
* @param [in] req Request that contains memh | ||
* @param [in] status Status of the error which caused abortion | ||
*/ | ||
int ucp_request_memh_invalidate(ucp_request_t *req, ucs_status_t status); | ||
void ucp_request_memh_invalidate(ucp_request_t *req, ucs_status_t status); | ||
|
||
ucs_status_t ucp_request_send_start(ucp_request_t *req, ssize_t max_short, | ||
size_t zcopy_thresh, size_t zcopy_max, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -222,10 +222,11 @@ static void ucp_proto_rndv_rtr_abort(ucp_request_t *req, ucs_status_t status) | |
rreq->status = status; | ||
ucp_request_set_callback(req, send.cb, ucp_proto_rndv_rtr_abort_super); | ||
|
||
if (ucp_request_memh_invalidate(req, status)) { | ||
if (ucp_request_memh_check_invalidate(req)) { | ||
if (req->send.rndv.rkey != NULL) { | ||
ucp_proto_rndv_rkey_destroy(req); | ||
} | ||
ucp_request_memh_invalidate(req, status); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are we able to add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should put |
||
ucp_proto_request_zcopy_id_reset(req); | ||
return; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems like no need in pointer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pointer is actually used to assign NULL to memh, on line 456:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pointer is not needed as a return value of this function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's needed, please check again
We assign NULL value to the request field, which address is stored in
memh_p
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah.. found it but IMO this is a not good idea to set value using "getter", maybe reset the field directly by
req->send.state.dt_iter.type.contig.memh = NULL
at line 448?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the hint. That would work if we always unconditionally replace original memh field by NULL.
But it's slightly more involved here, because I use the same function in
ucp_request_memh_check_invalidate
, that must not change the request, so it must be pure get.But I'll think a bit more on how to make it less confusing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I refactored it in the latest PR with entire invalidation solution, used extract approach:
03123f7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 does it mean that this PR is not relevant any more?
( just cross reference PRs #10204 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was hoping to merge this small low-risk PR in the current release, but no luck.
I will confirm with tech leads on Monday whether it makes sense to split the overall solution into several pieces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then maybe cherry-pick 03123f7 to here?