Repository navigation
Conversation
|
@evgeny-leksikov @brminich Can you please review? |
|
|
||
| UCS_TEST_P(test_ucp_sockaddr_protocols, tag_rndv_exp, "RNDV_THRESH=10k") | ||
| { | ||
| /* run send_recv twice so that the rndv threshold would be used */ |
There was a problem hiding this comment.
when the rndv_thresh is set, it's not used for the first message, so even if the message is larger than the set rndv_thresh, rndv will not be selected. it will be selected on the second message.
There was a problem hiding this comment.
maybe send smaller message as a first one?
There was a problem hiding this comment.
maybe send smaller message as a first one?
@brminich initially this test was added to check that first large message works correctly
There was a problem hiding this comment.
what is meant by correctly? That it is correctly sent, even though using eager protocol?
There was a problem hiding this comment.
yes, aka ep/request re-configuration issue due to protocol mismatch
There was a problem hiding this comment.
@evgeny-leksikov the 'first large message' will be sent with rndv if it's not the first message sent (before the connection was established). so sending a small message first shouldn't contradict what you are saying.
There was a problem hiding this comment.
AFAIU this is exactly before wireup is finished case
There was a problem hiding this comment.
let's change "test_tag_send_recv" to run several iterations (e.g 10) and add this comment there:
/* send multiple messages to test the protocol both before and after connection establishment */
| ucs_ptr_map_key_t req_id; /* the send request ID on receiver side */ | ||
| ucs_ptr_map_key_t sreq_id; /* the send request ID on receiver side */ | ||
| ucp_request_t *rreq; /* pointer to the receive request */ | ||
| ucs_ptr_map_key_t rreq_id; /* the receive request ID on receiver side */ |
There was a problem hiding this comment.
do we need both rreq and rreq_id now?
There was a problem hiding this comment.
since there is room for both, we thought to leave it there for now to avoid a look-up in the ptr_map.
There was a problem hiding this comment.
Is there any chance to access the pointer when rreq is released? let's say it's canceled on receiver side but sender is sending ACK.
IMO it looks strange I would keep something one and ID is preferrable
There was a problem hiding this comment.
if the recv side tries to remove an id of a non-existing rreq then the extract function would return NO_ELEM, isn't that what is expected?
or you mean to say we should remove the rreq from the map when it's canceled?
There was a problem hiding this comment.
- yes, we have to remove id from map before it's put to the pool or in worse case will be reused by next op
- yes, my concern about
rreqpointer
There was a problem hiding this comment.
maybe we should add rreq_id as a filed in the receive request itself (in the 'recv' part)
IMO it makes more sense each request will hold its own id
|
@evgeny-leksikov @brminich @yosefe Can you please review again? |
|
failure on #3897 |
| UCS_PROFILE_REQUEST_EVENT(req, multi_func_str, req->send.length); | ||
| } | ||
|
|
||
| static void ucp_request_get_id(ucp_request_t *req) |
There was a problem hiding this comment.
maybe ucp_send_request_init_id ?
There was a problem hiding this comment.
@evgeny-leksikov I renamed. please take a look.
|
failure on #4616 |
|
|
||
| ucs_ptr_map_key_t sreq_id; /* send request ID on the | ||
| sender side */ |
| std::string recv_buf(size, 'y'); | ||
| /* send multiple messages to test the protocol both before and after | ||
| * connection establishment */ | ||
| for (int i = 0; i < 10; i++) { |
3a4362d to
7d1cbe6
Compare
|
seems relevant |
| void *value; | ||
|
|
||
| if (ucs_likely(!(key & UCS_PTR_MAP_KEY_INDIRECT_FLAG))) { | ||
| ucs_assert(key != 0); |
There was a problem hiding this comment.
why? NULL is also pointer, kind of...
if this happens unexpectedly, IMO, it should be fixed/asserted in UCP
There was a problem hiding this comment.
why would you want to put a null pointer into the ptr_map..?
There was a problem hiding this comment.
IMO NULL pointer is incorrect usage (we expect an id to resolve to a valid object), and ptr_map can help by catching this early
- can add assert when adding element
There was a problem hiding this comment.
I don't :) but IMHO it should not be restricted in UCS
anyway let's do it symmetric - if assert then for both add/del
| if (ucp_ep_use_indirect_id(ep)) { | ||
| ucp_worker_del_request_id(sreq->send.ep->worker, sreq->send.msg_proto.sreq_id); | ||
| } |
There was a problem hiding this comment.
according to assert in UCS, sreq_id == NULL here? if yes, is it expected by protocol?
There was a problem hiding this comment.
when tag_offload is used, the msg_proto struct should not be access here, but rather the tag_offload struct (which doesn't have the sreq_id field).
but since tag_offload doesn't support error handling, the del_req_id function "won't do anything" anyway so it should be ok not to call it in this case.
There was a problem hiding this comment.
so it should be in
if (sreq->flags & UCP_REQUEST_FLAG_OFFLOADED) {
...
} else {
ucp_worker_del_request_id(sreq->send.ep->worker, sreq->send.msg_proto.sreq_id);
}
?
There was a problem hiding this comment.
checking ucp_ep_use_indirect_id(ep) makes the del_req_id call dependant on err_handling support rather than the used protocol (when checking the sreq->flags)
There was a problem hiding this comment.
but union in sreq->send (to access sreq->send.msg_proto.sreq_id) is protocol specific but not err_handleng mode
There was a problem hiding this comment.
yes but, adding and removing from the ptr_map is err_handling dependant.
There was a problem hiding this comment.
ucp_worker_del_request_id already should handle err handling inside by indirect flag presence, if sreq_id is not valid by some other logic - it should be handled accordingly
There was a problem hiding this comment.
for now let's check for NULL in ptr_map, it's usefult for TCP ep's as well and document it
if we'll have use case where map should hold NULL can move the check to upper layers
There was a problem hiding this comment.
what do you mean? we can't access msg_proto here for tag_offload
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| std::string recv_buf(size, 'y'); | ||
| /* send multiple messages to test the protocol both before and after | ||
| * connection establishment */ | ||
| for (int i = 0; i < 100; i++) { |
There was a problem hiding this comment.
I have a dependency on this change. @alinask what about creating a separate PR with sockaddr-only change to test before/after connection establishment? If you wish, I could help with that
There was a problem hiding this comment.
@dmitrygx which PR is dependent on this?
if you add only this change, of a loop around this code, it will fail on the ptr_map leak which this PR is fixing (and this change is reproducing).
|
Replaced with #6006 |
No description provided.