Hwloc: fixed detection of L2 cache size for some complex NUMA topologies

This commit is contained in:
SChernykh 2025-06-17 13:49:02 +02:00
parent bcc5581535
commit d125d22d27

View file

@ -311,10 +311,9 @@ void xmrig::HwlocCpuInfo::processTopLevelCache(hwloc_obj_t cache, const Algorith
uint32_t intensity = algorithm.maxIntensity() == 1 ? 0 : 1; uint32_t intensity = algorithm.maxIntensity() == 1 ? 0 : 1;
if (cache->attr->cache.depth == 3) { if (cache->attr->cache.depth == 3) {
for (size_t i = 0; i < cache->arity; ++i) { auto process_L2 = [&L2, &L2_associativity, L3_exclusive, this, &extra, scratchpad](hwloc_obj_t l2) {
hwloc_obj_t l2 = cache->children[i];
if (!hwloc_obj_type_is_cache(l2->type) || l2->attr == nullptr) { if (!hwloc_obj_type_is_cache(l2->type) || l2->attr == nullptr) {
continue; return;
} }
L2 += l2->attr->cache.size; L2 += l2->attr->cache.size;
@ -329,6 +328,18 @@ void xmrig::HwlocCpuInfo::processTopLevelCache(hwloc_obj_t cache, const Algorith
extra += scratchpad; extra += scratchpad;
} }
} }
};
for (size_t i = 0; i < cache->arity; ++i) {
hwloc_obj_t ch = cache->children[i];
if (ch->type == HWLOC_OBJ_GROUP) {
for (size_t j = 0; j < ch->arity; ++j) {
process_L2(ch->children[j]);
}
}
else {
process_L2(ch);
}
} }
} }