Skip to content

Commit 0685cb8

Browse files
committed
core: AND allowed sets with normal sets in the allow(LOCAL) case
In some (old?) corner cases, Linux cpusets may return offline PUs in the allowed sets of cpusets/cgroups. Signed-off-by: Brice Goglin <[email protected]>
1 parent a8e8e7d commit 0685cb8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

hwloc/topology.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4242,6 +4242,9 @@ hwloc_topology_allow(struct hwloc_topology *topology,
42424242
goto error;
42434243
}
42444244
topology->binding_hooks.get_allowed_resources(topology);
4245+
/* make sure the backend returned something sane (Linux cpusets may return offline PUs in some cases) */
4246+
hwloc_bitmap_and(topology->allowed_cpuset, topology->allowed_cpuset, hwloc_get_root_obj(topology)->cpuset);
4247+
hwloc_bitmap_and(topology->allowed_nodeset, topology->allowed_nodeset, hwloc_get_root_obj(topology)->nodeset);
42454248
break;
42464249
}
42474250
case HWLOC_ALLOW_FLAG_CUSTOM: {

0 commit comments

Comments
 (0)