Repository navigation
Conversation
|
🤖 Starting review — findings will be posted here when done. |
| /** | ||
| * @return remote key configuration by configuration index | ||
| */ | ||
| static inline ucp_rkey_config_t * |
There was a problem hiding this comment.
pls use UCS_F_ALWAYS_INLINE, since ucp_rkey_config() is on the RMA short path (ucp_put_send_short, amo_send).
| static inline ucp_rkey_config_t * | |
| static UCS_F_ALWAYS_INLINE ucp_rkey_config_t * | |
| ucp_worker_rkey_config(ucp_worker_h worker, ucp_worker_cfg_index_t cfg_index) |
|
|
||
| /* rkey configuration storage */ | ||
| UCS_ARRAY_DECLARE_TYPE(ucp_rkey_config_arr_t, unsigned, ucp_rkey_config_t); | ||
| UCS_ARRAY_DECLARE_TYPE(ucp_rkey_config_arr_t, unsigned, ucp_rkey_config_t*); |
There was a problem hiding this comment.
this adds an extra pointer dereference to ucp_rkey_config() in the put_short/amo fast path; did you check there is no message-rate impact?
| goto err;); | ||
| rkey_cfg_index = ucs_array_length(&worker->rkey_config); | ||
| rkey_config = ucs_malloc(sizeof(*rkey_config), "rkey_config"); | ||
| if (rkey_config == NULL) { |
There was a problem hiding this comment.
pls log the allocation failure, like the other allocations in this file (ucs_error("failed to allocate worker ifaces") etc.); previously ucs_array_grow() printed it for us.
| if (rkey_config == NULL) { | |
| rkey_config = ucs_malloc(sizeof(*rkey_config), "rkey_config"); | |
| if (rkey_config == NULL) { | |
| ucs_error("failed to allocate rkey configuration"); | |
| status = UCS_ERR_NO_MEMORY; | |
| goto err; | |
| } |
| old_buffer = ucs_array_begin(&worker()->rkey_config); | ||
|
|
||
| /* Grow past the initial reserve using the production path only */ | ||
| for (key.md_map = 1; key.md_map <= 64; ++key.md_map) { |
There was a problem hiding this comment.
the bound 64 silently depends on the ucs_array_reserve(&worker->rkey_config, 32) in ucp_worker_create(); can we derive it from the initial ucs_array_capacity(&worker()->rkey_config) so ASSERT_NE(old_buffer, ...) does not become a no-op if the reserve changes?
|
Coverage note: the new test does fail without the fix (the first config pointer moves after reallocation), which satisfies the regression-test expectation. One residual gap: the test covers pointer stability, not the behavior the removed FIXME described (a proto_select cache/pointer used across a recursive rkey-config addition). Existing coverage for that path is test_ucp_proto_mock/test_ucp_proto rndv remote-proto selection, which exercises recursive ucp_worker_rkey_config_get() but not with a forced reallocation. Not worth blocking on. |
Backport #11676.