Skip to content

Commit 4310576

Browse files
committed
linux/numa: disable memory attributes and memory-side cache in fake numa
HMAT information isn't updated when fake numa is enabled, so ignore it for now. In the uniform splitting fake numa case, we could update HMAT info since node #K is replaced with nodes #KN-#(K+1)N-1. In theory, the Linux kernel should fix HMAT info to match the fakenuma config, but it looks like it's not going to happen soon, we'll see later if we need/want to fix it in hwloc. Signed-off-by: Brice Goglin <[email protected]>
1 parent 5fa4739 commit 4310576

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

hwloc/topology-linux.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3975,9 +3975,18 @@ look_sysfsnode(struct hwloc_topology *topology,
39753975
char *env;
39763976
int allow_overlapping_node_cpusets = 0;
39773977
int need_memcaches = hwloc_filter_check_keep_object_type(topology, HWLOC_OBJ_MEMCACHE);
3978+
int need_memattrs = !(topology->flags & HWLOC_TOPOLOGY_FLAG_NO_MEMATTRS);
39783979

39793980
hwloc_debug("\n\n * Topology extraction from /sys/devices/system/node *\n\n");
39803981

3982+
if (data->is_fake_numa_uniform) {
3983+
hwloc_debug("Disabling memory-side caches, memory attributes and HMAT initiators because of fake numa\n");
3984+
need_memcaches = 0;
3985+
need_memattrs = 0;
3986+
data->use_numa_initiators = 0;
3987+
allow_overlapping_node_cpusets = 2; /* accept without warning */
3988+
}
3989+
39813990
env = getenv("HWLOC_DEBUG_ALLOW_OVERLAPPING_NODE_CPUSETS");
39823991
if (env) {
39833992
allow_overlapping_node_cpusets = atoi(env); /* 0 drop non-first overlapping nodes, 1 allows with warning, 2 allows without warning */
@@ -4183,7 +4192,7 @@ look_sysfsnode(struct hwloc_topology *topology,
41834192
trees[nr_trees++] = tree;
41844193
}
41854194
/* By the way, get their memattrs now that cpuset is fixed */
4186-
if (!(topology->flags & HWLOC_TOPOLOGY_FLAG_NO_MEMATTRS))
4195+
if (need_memattrs)
41874196
read_node_local_memattrs(topology, data, node);
41884197
}
41894198

0 commit comments

Comments
 (0)