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

core/util: add fallback logic for MR caching selection #12

Closed
wants to merge 5 commits into from
Closed
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
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ common_srcs = \
prov/util/src/util_ns.c \
prov/util/src/util_shm.c \
prov/util/src/util_mem_monitor.c\
prov/util/src/util_mem_hooks.c \
prov/util/src/util_mr_cache.c


Expand Down
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,9 @@ AS_IF([test $have_uffd -eq 1],
AC_DEFINE_UNQUOTED([HAVE_UFFD_UNMAP], [$have_uffd],
[Define to 1 if platform supports userfault fd unmap])

dnl Check support to intercept syscalls
AC_CHECK_HEADERS_ONCE(elf.h sys/auxv.h)

dnl Provider-specific checks
FI_PROVIDER_INIT
FI_PROVIDER_SETUP([psm])
Expand Down
19 changes: 17 additions & 2 deletions include/ofi_mr.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
#include <ofi_list.h>
#include <ofi_tree.h>


struct ofi_mr_info {
struct iovec iov;
};
Expand Down Expand Up @@ -125,6 +124,8 @@ int ofi_monitor_subscribe(struct ofi_mem_monitor *monitor,
void ofi_monitor_unsubscribe(struct ofi_mem_monitor *monitor,
const void *addr, size_t len);

extern struct ofi_mem_monitor *default_monitor;

/*
* Userfault fd memory monitor
*/
Expand All @@ -139,6 +140,19 @@ void ofi_uffd_cleanup(void);

extern struct ofi_mem_monitor *uffd_monitor;

/*
* Memory intercept call memory monitor
*/
struct ofi_memhooks {
struct ofi_mem_monitor monitor;
struct dlist_entry intercept_list;
};

int ofi_memhooks_init(void);
void ofi_memhooks_cleanup(void);

extern struct ofi_mem_monitor *memhooks_monitor;


/*
* Used to store registered memory regions into a lookup map. This
Expand Down Expand Up @@ -184,7 +198,7 @@ int ofi_mr_close(struct fid *fid);
int ofi_mr_regattr(struct fid *fid, const struct fi_mr_attr *attr,
uint64_t flags, struct fid_mr **mr_fid);
int ofi_mr_regv(struct fid *fid, const struct iovec *iov,
size_t count, uint64_t access, uint64_t offset,
size_t count, uint64_t access, uint64_t offset,
uint64_t requested_key, uint64_t flags,
struct fid_mr **mr_fid, void *context);
int ofi_mr_reg(struct fid *fid, const void *buf, size_t len,
Expand All @@ -201,6 +215,7 @@ struct ofi_mr_cache_params {
size_t max_cnt;
size_t max_size;
int merge_regions;
char * monitor;
};

extern struct ofi_mr_cache_params cache_params;
Expand Down
1 change: 1 addition & 0 deletions libfabric.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@
<ClCompile Include="prov\util\src\util_poll.c" />
<ClCompile Include="prov\util\src\util_wait.c" />
<ClCompile Include="prov\util\src\util_mem_monitor.c" />
<ClCompile Include="prov\util\src\util_mem_hooks.c" />
<ClCompile Include="prov\util\src\util_mr_cache.c" />
<ClCompile Include="src\common.c" />
<ClCompile Include="src\enosys.c">
Expand Down
3 changes: 3 additions & 0 deletions libfabric.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@
<ClCompile Include="prov\util\src\util_mem_monitor.c">
<Filter>Source Files\prov\util</Filter>
</ClCompile>
<ClCompile Include="prov\util\src\util_mem_hooks.c">
<Filter>Source Files\prov\util</Filter>
</ClCompile>
<ClCompile Include="prov\util\src\util_mr_cache.c">
<Filter>Source Files\prov\util</Filter>
</ClCompile>
Expand Down
Loading