SWDEV-322225 - Use numa_allocate_bitmask

- Fix a crash with AMD_CPU_AFFINITY=1 as numa_bitmask_alloc isnt the
right api to allocate bitmask
- Do not set affinity for ROCr thread. It worsens performance rather
than any improvement.
- Fix regression from my previous change for event handler.

Change-Id: I3ea75adc2a6333f29752283eddd5b555e9b58cc5
This commit is contained in:
Saleel Kudchadker
2022-03-24 22:00:42 -07:00
parent f8a6099344
commit 802c2c8a9f
2 ha cambiato i file con 36 aggiunte e 39 eliminazioni
+2 -5
Vedi File
@@ -310,11 +310,8 @@ void Os::setCurrentThreadName(const char* name) { ::prctl(PR_SET_NAME, name); }
void Os::setPreferredNumaNode(uint32_t node) {
#ifdef ROCCLR_SUPPORT_NUMA_POLICY
if (AMD_CPU_AFFINITY) {
// Set preferred node affinity mask
int num_cpus = numa_num_configured_cpus();
bitmask* bm = numa_bitmask_alloc(num_cpus);
if (AMD_CPU_AFFINITY && (numa_available() >= 0)) {
bitmask* bm = numa_allocate_cpumask();
numa_node_to_cpus(node, bm);
if (numa_sched_setaffinity(0, bm) < 0) {
assert(0 && "failed to set affinity");