-
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?
Conversation
5183688
to
7bc2c14
Compare
if (req->send.rndv.rkey != NULL) { | ||
ucp_proto_rndv_rkey_destroy(req); | ||
} | ||
ucp_proto_request_zcopy_id_reset(req); | ||
ucp_request_memh_invalidate(req, status); |
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.
are we able to add ucp_request_memh_invalidate()
right after the check line 226, or some req
field might touched after?
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 think we should put ucp_request_memh_invalidate
call just before ucp_proto_request_zcopy_id_reset
.
But we cannot put it before ucp_proto_rndv_rkey_destroy
, because that function uses field from union rndv
part of the request, which gets invalidated by invalidate
struct.
@@ -395,50 +395,65 @@ static ucp_md_map_t ucp_request_get_invalidation_map(ucp_ep_h ep) | |||
return inv_map; | |||
} | |||
|
|||
int ucp_request_memh_invalidate(ucp_request_t *req, ucs_status_t status) | |||
static UCS_F_ALWAYS_INLINE ucp_mem_h* ucp_request_get_memh(ucp_request_t *req) |
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
static UCS_F_ALWAYS_INLINE ucp_mem_h* ucp_request_get_memh(ucp_request_t *req) | |
static UCS_F_ALWAYS_INLINE ucp_mem_h ucp_request_get_memh(ucp_request_t *req) |
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:
*memh_p = NULL;
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?
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
- pls move under
UCS_ENABLE_ASSERT
section - need better name since it's irrelevant for any request, e.g.
UCP_REQUEST_FLAG_MEMH_INVALIDATED
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.
In this PR it's used only within ucs_assert
, but in the upcoming invalidation PR I use this flag in a couple of places to check whether request had been already invalidated. But I'll check once again if I manage to get rid of those checks. So far it's not easy, because in some parts of the code after invalidation we still access rndv
part.
This flag indicates invalidated request (not just memory handle), meaning the request which populated invalidate
struct from the send
union. As a consequence, we cannot safely access other union structures from invalidated request (e.g. we can't anymore safely access rndv
part). So in fact this is the property of request itself
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.
- lets move back when and IF it's really needed
- we dont have dedicated flags for union members, all prevoius flags named by state and/or action, IMO "invalidated request " may have to wide meaning without context
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 think I will add code to this PR that actually uses this flag in production code path
What
The aim of this PR is to prepare infra for RNDV PPLN invalidation, which will be implemented without using rcache invalidation. Currently rcache stores completion entries within its private memory pool, and the proposed change is to move that completion entry to UCP request.
Why ?
invalidate
union structHow ?
invalidate
struct