Skip to content

Commit de649e7

Browse files
Yuwei Guanrppt
authored andcommitted
memblock: Update nid info in memblock debugfs
The node id for memblock reserved regions will be wrong, so let's show 'x' for reg->nid == MAX_NUMNODES in debugfs to keep it align. Suggested-by: Mike Rapoport (IBM) <[email protected]> Co-developed-by: Kefeng Wang <[email protected]> Signed-off-by: Kefeng Wang <[email protected]> Signed-off-by: Yuwei Guan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mike Rapoport (IBM) <[email protected]>
1 parent 493f349 commit de649e7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

mm/memblock.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2169,17 +2169,21 @@ static int memblock_debug_show(struct seq_file *m, void *private)
21692169
{
21702170
struct memblock_type *type = m->private;
21712171
struct memblock_region *reg;
2172-
int i, j;
2172+
int i, j, nid;
21732173
unsigned int count = ARRAY_SIZE(flagname);
21742174
phys_addr_t end;
21752175

21762176
for (i = 0; i < type->cnt; i++) {
21772177
reg = &type->regions[i];
21782178
end = reg->base + reg->size - 1;
2179+
nid = memblock_get_region_node(reg);
21792180

21802181
seq_printf(m, "%4d: ", i);
21812182
seq_printf(m, "%pa..%pa ", &reg->base, &end);
2182-
seq_printf(m, "%4d ", memblock_get_region_node(reg));
2183+
if (nid != MAX_NUMNODES)
2184+
seq_printf(m, "%4d ", nid);
2185+
else
2186+
seq_printf(m, "%4c ", 'x');
21832187
if (reg->flags) {
21842188
for (j = 0; j < count; j++) {
21852189
if (reg->flags & (1U << j)) {

0 commit comments

Comments
 (0)