Skip to content

Commit

Permalink
linux: get_allowed_resources() shouldn't duplicate the LinuxCgroup in…
Browse files Browse the repository at this point in the history
…fo attr

The internal hook can be called by the backend, and later again if
THISSYSTEM_ALLOWED_RESOURCES is forced.
Replace the existing LinuxCgroup info attr if any.

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
  • Loading branch information
bgoglin committed Jun 29, 2018
1 parent 3d793f2 commit bea59a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hwloc/topology-linux.c
Expand Up @@ -2033,7 +2033,8 @@ static int hwloc_linux_get_allowed_resources_hook(hwloc_topology_t topology)

hwloc_linux__get_allowed_resources(topology, fsroot_path, root_fd, &cpuset_name);
if (cpuset_name) {
hwloc_obj_add_info(topology->levels[0][0], "LinuxCgroup", cpuset_name);
hwloc__add_info_nodup(&topology->levels[0][0]->infos, &topology->levels[0][0]->infos_count,
"LinuxCgroup", cpuset_name, 1 /* replace */);
free(cpuset_name);
}
if (root_fd != -1)
Expand Down

0 comments on commit bea59a8

Please sign in to comment.