Skip to content
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

prov/shm: proposal for new shm architecture #10693

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/ofi.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ static inline int ofi_val32_ge(uint32_t x, uint32_t y) {
#define IFFLAGSTRN2(flags, SYMVAL, SYMNAME, N) \
do { if (flags & SYMVAL) ofi_strncatf(buf, N, #SYMNAME ", "); } while(0)

#define STATIC_ASSERT(cond, name) \
typedef char static_assertion_##name[(cond) ? 1 : -1]

/*
* CPU specific features
Expand Down
3 changes: 3 additions & 0 deletions include/ofi_hmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,9 @@ ssize_t ofi_copy_from_mr_iov(void *dest, size_t size, struct ofi_mr **mr,
ssize_t ofi_copy_to_mr_iov(struct ofi_mr **mr, const struct iovec *iov,
size_t iov_count, uint64_t iov_offset,
const void *src, size_t size);
ssize_t ofi_copy_mr_iov(struct ofi_mr **mr, const struct iovec *iov,
size_t iov_count, size_t offset, void *buf,
size_t size, int dir);

int ofi_hmem_get_handle(enum fi_hmem_iface iface, void *base_addr,
size_t size, void **handle);
Expand Down
14 changes: 14 additions & 0 deletions include/ofi_mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,14 @@ static inline void smr_freestack_push_by_offset(struct smr_freestack *fs,
fs->object_size);
}

/* Get entry index in fs */
static inline int16_t smr_freestack_get_index(struct smr_freestack *fs,
char *local_p)
{
return (local_p - ((char*) fs + fs->entry_base_offset)) /
fs->object_size;
}

/* Push by object */
static inline void smr_freestack_push(struct smr_freestack *fs, void *local_p)
{
Expand Down Expand Up @@ -318,6 +326,12 @@ static inline void* smr_freestack_pop(struct smr_freestack *fs)
{
return (void *) ( ((char*)fs) + smr_freestack_pop_by_offset(fs) );
}

static inline int16_t smr_freestack_avail(struct smr_freestack *fs)
{
return fs->free;
}

/*
* Buffer Pool
*/
Expand Down
2 changes: 1 addition & 1 deletion include/ofi_xpmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ typedef int64_t xpmem_segid_t;
#endif /* HAVE_XPMEM */

struct ofi_xpmem_client {
uint8_t cap;
bool avail;
xpmem_apid_t apid;
uintptr_t addr_max;
};
Expand Down
2 changes: 0 additions & 2 deletions prov/shm/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ _shm_files = \
prov/shm/src/smr_av.c \
prov/shm/src/smr_signal.h \
prov/shm/src/smr.h \
prov/shm/src/smr_dsa.h \
prov/shm/src/smr_dsa.c \
prov/shm/src/smr_util.h \
prov/shm/src/smr_util.c


Expand Down
Loading
Loading