Skip to content

Commit

Permalink
linux/knl: enforce DRAM subtype for KNL DDR
Browse files Browse the repository at this point in the history
It's already guessed by memtiers, but set it early anyway since we're sure it's correct.

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
  • Loading branch information
bgoglin committed Oct 26, 2023
1 parent bdf2d98 commit 1da57da
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hwloc/memattrs.c
Expand Up @@ -1406,7 +1406,10 @@ hwloc__group_memory_tiers(hwloc_topology_t topology,
}
}

/* sort nodes */
/* Sort nodes.
* We could also sort by the existing subtype.
* KNL is the only case where subtypes are set in backends, but we set memattrs as well there.
*/
hwloc_debug("Sorting memory node infos...\n");
qsort(nodeinfos, n, sizeof(*nodeinfos), compare_node_infos_by_type_and_bw);
#ifdef HWLOC_DEBUG
Expand Down
4 changes: 4 additions & 0 deletions hwloc/topology-linux.c
Expand Up @@ -3274,6 +3274,10 @@ hwloc_linux_knl_add_cluster(struct hwloc_topology *topology,
*/
hwloc_bitmap_copy(mcdram->cpuset, ddr->cpuset);

/* also mark ddr as DRAM to match what we do in memattrs.c */
assert(ddr);
ddr->subtype = strdup("DRAM");

/* Add a Group for Cluster containing this MCDRAM + DDR */
cluster = hwloc_alloc_setup_object(topology, HWLOC_OBJ_GROUP, HWLOC_UNKNOWN_INDEX);
hwloc_obj_add_other_obj_sets(cluster, ddr);
Expand Down

0 comments on commit 1da57da

Please sign in to comment.