Skip to content

Commit

Permalink
prov/shm: new shm architecture
Browse files Browse the repository at this point in the history
Replacement of shm protocols with new architecture.

Significant changes:

- Turn response queue into return queue for local commands. Inline
commands are still receive side. All commands have an inline option
but a common ptr to the command being used for remote commands.
These commands have to be returned to the sender but the receive side
can hold onto them as long as needed for the lifetime of the message

- shm has self and peer caps for each p2p interface (right now just
CMA and xpmem). The support for each of these interfaces is saved
in separate fields which causes a lot of wasted memory and is
confusing. This merges these into two fields (one for self and one for
peer) which holds the information for all p2p interfaces and is
accessed by the P2P type enums. CMA also needs a flag to know wether
CMA support has been queried yet or not.

- Move some shm fields around for alignment

- Simplifies access to the map to remove need for container

- There is a 1:1 relationship with the av and map so just reuse
the util av lock for access to the map as well. This requires some
reorganizing of the locking semantics

- There is nothing in smr_fabric. Remove and just use the util_fabric directly

- Just like on the send side, make the progress functions be an array
of function pointers accessible by the command proto. This cleans up the
parameters of the progress calls and streamlines the calls

- Merge tx and pend entries for simple management of pending operations

- Redefinition of cmd and header for simplicty and easier reading. Also
removes and adds fields for new architecture

- Refactor async ipc list and turn it into a generic async list to track
asynchronous copies which can be used for any accelerator (GPU or DSA) that
copies locally asynchronously.

- Cleanup naming and organization for readibility. Shorten some names to
help with line length and organization

- Fix weird header dependency smr_util.c->smr.h->smr_util.h so that smr_util.c
is only dependent on smr_util.h and is isolated to solely shm region and
protocol definitions. This separates the shm utilities from being dependent
on the provider leaving the door open for reuse of the shm utilities if needed

Signed-off-by: Alexia Ingerson <alexia.ingerson@intel.com>
  • Loading branch information
aingerson committed Feb 21, 2025
1 parent 5df45cd commit 9f309aa
Show file tree
Hide file tree
Showing 19 changed files with 2,347 additions and 2,637 deletions.
312 changes: 176 additions & 136 deletions prov/shm/src/smr.h

Large diffs are not rendered by default.

303 changes: 171 additions & 132 deletions prov/shm/src/smr_atomic.c

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions prov/shm/src/smr_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ struct fi_domain_attr smr_domain_attr = {
.av_type = FI_AV_UNSPEC,
.mr_mode = OFI_MR_BASIC | OFI_MR_SCALABLE,
.mr_key_size = sizeof_field(struct fi_rma_iov, key),
.cq_data_size = sizeof_field(struct smr_msg_hdr, data),
.cq_data_size = sizeof_field(struct smr_cmd_hdr, cq_data),
.cq_cnt = (1 << 10),
.ep_cnt = SMR_MAX_PEERS,
.tx_ctx_cnt = (1 << 10),
Expand All @@ -121,7 +121,7 @@ struct fi_domain_attr smr_hmem_domain_attr = {
.av_type = FI_AV_UNSPEC,
.mr_mode = FI_MR_HMEM,
.mr_key_size = sizeof_field(struct fi_rma_iov, key),
.cq_data_size = sizeof_field(struct smr_msg_hdr, data),
.cq_data_size = sizeof_field(struct smr_cmd_hdr, cq_data),
.cq_cnt = (1 << 10),
.ep_cnt = SMR_MAX_PEERS,
.tx_ctx_cnt = (1 << 10),
Expand Down Expand Up @@ -157,4 +157,4 @@ struct fi_info smr_info = {
.domain_attr = &smr_domain_attr,
.fabric_attr = &smr_fabric_attr,
.next = &smr_hmem_info,
};
};
Loading

0 comments on commit 9f309aa

Please sign in to comment.