Skip to content

Commit

Permalink
numactl.c: Fix merging of neighboring pages' policies in dump_shm
Browse files Browse the repository at this point in the history
In addition to checking that the policies are equal, also check that
the nodes are equal, since the policies may be the same but apply to
different nodes.

Fixes #170
  • Loading branch information
Ackerley Tng authored and andikleen committed Mar 15, 2023
1 parent 17ea3b1 commit 6587ed2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,12 @@ void dump_shm(void)
if (get_mempolicy(&pol, nodes->maskp, nodes->size, c+shmptr,
MPOL_F_ADDR) < 0)
err("get_mempolicy on shm");
if (pol == prevpol)
if (pol == prevpol && numa_bitmask_equal(prevnodes, nodes))
continue;
if (prevpol != -1)
dumppol(start, c, prevpol, prevnodes);
prevnodes = nodes;

copy_bitmask_to_bitmask(nodes, prevnodes);
prevpol = pol;
start = c;
}
Expand Down

0 comments on commit 6587ed2

Please sign in to comment.