1
1

COMMON/UCX: init memhooks infra on external hooks only

- initialize memory hooks infrastructure only in case
  if external memory hooks are requested

Signed-off-by: Sergey Oblomov <sergeyo@mellanox.com>
Этот коммит содержится в:
Sergey Oblomov 2019-05-16 20:13:16 +03:00
родитель fe5ad67127
Коммит a0a9306066

Просмотреть файл

@ -16,6 +16,7 @@
#include "opal/memoryhooks/memory.h"
#include <ucm/api/ucm.h>
#include <ucs/sys/math.h>
/***********************************************************************/
@ -91,6 +92,8 @@ OPAL_DECLSPEC void opal_common_ucx_mca_register(void)
opal_common_ucx.output = opal_output_open(NULL);
opal_output_set_verbosity(opal_common_ucx.output, opal_common_ucx.verbose);
/* Set memory hooks */
if (opal_common_ucx.opal_mem_hooks) {
ret = mca_base_framework_open(&opal_memory_base_framework, 0);
if (OPAL_SUCCESS != ret) {
/* failed to initialize memory framework - just exit */
@ -99,17 +102,14 @@ OPAL_DECLSPEC void opal_common_ucx_mca_register(void)
return;
}
/* Set memory hooks */
if (opal_common_ucx.opal_mem_hooks &&
(OPAL_MEMORY_FREE_SUPPORT | OPAL_MEMORY_MUNMAP_SUPPORT) ==
((OPAL_MEMORY_FREE_SUPPORT | OPAL_MEMORY_MUNMAP_SUPPORT) &
opal_mem_hooks_support_level()))
{
if (ucs_test_all_flags(opal_mem_hooks_support_level(),
OPAL_MEMORY_FREE_SUPPORT | OPAL_MEMORY_MUNMAP_SUPPORT)) {
MCA_COMMON_UCX_VERBOSE(1, "%s", "using OPAL memory hooks as external events");
ucm_set_external_event(UCM_EVENT_VM_UNMAPPED);
opal_mem_hooks_register_release(opal_common_ucx_mem_release_cb, NULL);
}
}
}
OPAL_DECLSPEC void opal_common_ucx_mca_deregister(void)
{