Skip to content

Commit 6369a87

Browse files
committed
linux: slightly improve the ia64-specific empty cacheset workaround
CID #1397109 Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
1 parent 5e964c4 commit 6369a87

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

hwloc/topology-linux.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3382,10 +3382,15 @@ look_sysfscpu(struct hwloc_topology *topology,
33823382
cacheset = hwloc_parse_cpumap(str, data->root_fd);
33833383
if (cacheset) {
33843384
if (hwloc_bitmap_iszero(cacheset)) {
3385+
hwloc_bitmap_t tmpset;
33853386
/* ia64 returning empty L3 and L2i? use the core set instead */
3386-
hwloc_bitmap_free(cacheset);
33873387
sprintf(str, "%s/cpu%d/topology/thread_siblings", path, i);
3388-
cacheset = hwloc_parse_cpumap(str, data->root_fd);
3388+
tmpset = hwloc_parse_cpumap(str, data->root_fd);
3389+
/* only use it if we actually got something */
3390+
if (tmpset) {
3391+
hwloc_bitmap_free(cacheset);
3392+
cacheset = tmpset;
3393+
}
33893394
}
33903395
hwloc_bitmap_andnot(cacheset, cacheset, unknownset);
33913396

0 commit comments

Comments
 (0)