Skip to content

Commit 6e961cd

Browse files
[CPU] Avoid printing mbind errno message to stderr (#23874)
### Details: - If a process lacks CAP_SYS_NICE capability, mbind fails with an error "Operation not permitted". We should either ignore the result (just log) or throw an exception. Also, as an option, we could check if CAP_SYS_NICE is set before performing any mbind related logic. - For now just log to the debug
1 parent 8a97fda commit 6e961cd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/plugins/intel_cpu/src/cpu_memory.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
#include "memory_desc/cpu_memory_desc_utils.h"
77
#include <common/memory_desc_wrapper.hpp>
88
#include "nodes/reorder.h"
9+
#include "utils/debug_capabilities.h"
910
#if defined(__linux__)
1011
# include <sys/syscall.h> /* Definition of SYS_* constants */
1112
# include <unistd.h>
13+
# include <cstring> /* strerror(errno) */
1214
#endif
1315

1416
namespace ov {
@@ -631,9 +633,11 @@ bool mbind_move(void* data, size_t size, int targetNode) {
631633
mask = 1ul << realNode;
632634
flags = MPOL_MF_MOVE | MPOL_MF_STRICT;
633635
}
636+
634637
auto rc = mbind(pages, page_count * pagesize, MPOL_BIND, &mask, sizeof(mask) * 8, flags);
635638
if (rc < 0) {
636-
perror("mbind failed");
639+
DEBUG_LOG("mbind failed: ", strerror(errno));
640+
return false;
637641
}
638642
return true;
639643
}

0 commit comments

Comments
 (0)