Skip to content

Commit 1da57da

Browse files
committed
linux/knl: enforce DRAM subtype for KNL DDR
It's already guessed by memtiers, but set it early anyway since we're sure it's correct. Signed-off-by: Brice Goglin <[email protected]>
1 parent bdf2d98 commit 1da57da

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

hwloc/memattrs.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1406,7 +1406,10 @@ hwloc__group_memory_tiers(hwloc_topology_t topology,
14061406
}
14071407
}
14081408

1409-
/* sort nodes */
1409+
/* Sort nodes.
1410+
* We could also sort by the existing subtype.
1411+
* KNL is the only case where subtypes are set in backends, but we set memattrs as well there.
1412+
*/
14101413
hwloc_debug("Sorting memory node infos...\n");
14111414
qsort(nodeinfos, n, sizeof(*nodeinfos), compare_node_infos_by_type_and_bw);
14121415
#ifdef HWLOC_DEBUG

hwloc/topology-linux.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3274,6 +3274,10 @@ hwloc_linux_knl_add_cluster(struct hwloc_topology *topology,
32743274
*/
32753275
hwloc_bitmap_copy(mcdram->cpuset, ddr->cpuset);
32763276

3277+
/* also mark ddr as DRAM to match what we do in memattrs.c */
3278+
assert(ddr);
3279+
ddr->subtype = strdup("DRAM");
3280+
32773281
/* Add a Group for Cluster containing this MCDRAM + DDR */
32783282
cluster = hwloc_alloc_setup_object(topology, HWLOC_OBJ_GROUP, HWLOC_UNKNOWN_INDEX);
32793283
hwloc_obj_add_other_obj_sets(cluster, ddr);

0 commit comments

Comments
 (0)