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

UCT/MM: Replaced error value with debug log message for shm_unlink #9670

Merged
merged 2 commits into from
Feb 15, 2024
Merged
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
14 changes: 6 additions & 8 deletions src/uct/sm/mm/posix/mm_posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ static ucs_status_t uct_posix_procfs_open(int pid, int peer_fd, int* fd_p)
return uct_posix_open_check_result("open", file_path, 0, ret, fd_p);
}

static ucs_status_t uct_posix_unlink(uct_mm_md_t *md, uint64_t seg_id)
static ucs_status_t
uct_posix_unlink(uct_mm_md_t *md, uint64_t seg_id, ucs_log_level_t err_level)
{
uct_posix_md_config_t *posix_config = ucs_derived_of(md->config,
uct_posix_md_config_t);
Expand All @@ -286,7 +287,7 @@ static ucs_status_t uct_posix_unlink(uct_mm_md_t *md, uint64_t seg_id)
seg_id & UCT_POSIX_SEG_MMID_MASK);
ret = shm_unlink(file_path);
if (ret < 0) {
ucs_error("shm_unlink(%s) failed: %m", file_path);
ucs_log(err_level, "shm_unlink(%s) failed: %m", file_path);
return UCS_ERR_SHMEM_SEGMENT;
}
} else {
Expand Down Expand Up @@ -515,10 +516,7 @@ uct_posix_mem_alloc(uct_md_h tl_md, size_t *length_p, void **address_p,
/* If using procfs link instead of mmid, remove the original file and update
* seg->seg_id */
if (posix_config->use_proc_link) {
status = uct_posix_unlink(md, seg->seg_id);
if (status != UCS_OK) {
goto err_close;
}
uct_posix_unlink(md, seg->seg_id, UCS_LOG_LEVEL_DIAG);

/* Replace mmid by pid+fd. Keep previous SHM_OPEN flag for mkey_pack() */
seg->seg_id = uct_posix_mmid_procfs_pack(fd) |
Expand Down Expand Up @@ -586,7 +584,7 @@ uct_posix_mem_alloc(uct_md_h tl_md, size_t *length_p, void **address_p,
err_close:
close(fd);
if (!(seg->seg_id & UCT_POSIX_SEG_FLAG_PROCFS)) {
uct_posix_unlink(md, seg->seg_id);
uct_posix_unlink(md, seg->seg_id, UCS_LOG_LEVEL_WARN);
}
err_free_seg:
ucs_free(seg);
Expand All @@ -612,7 +610,7 @@ static ucs_status_t uct_posix_mem_free(uct_md_h tl_md, uct_mem_h memh)
ucs_assert(dummy_pid == getpid());
close(fd);
} else {
status = uct_posix_unlink(md, seg->seg_id);
status = uct_posix_unlink(md, seg->seg_id, UCS_LOG_LEVEL_ERROR);
if (status != UCS_OK) {
return status;
}
Expand Down
Loading