Re: [PATCH v2] memblock: Add flags and nid info in memblock debugfs

From: Mike Rapoport
Date: Wed May 17 2023 - 09:44:02 EST


On Wed, May 17, 2023 at 10:57:47AM +0800, Yuwei Guan wrote:
> Currently, the memblock debugfs can display the count of memblock_type and
> the base and end of the reg. However, when the following scenario occurs,
> the information in the existing debugfs cannot make it clear why the
> address is not consecutive.

...

> diff --git a/mm/memblock.c b/mm/memblock.c
> index 511d4783dcf1..b36fb6b31e0f 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -2144,12 +2144,16 @@ static int memblock_debug_show(struct seq_file *m, void *private)
> int i;
> phys_addr_t end;
>
> + seq_puts(m, "cnt\tbase..end\tflags\tnid\n");
> +
> for (i = 0; i < type->cnt; i++) {
> reg = &type->regions[i];
> end = reg->base + reg->size - 1;
>
> - seq_printf(m, "%4d: ", i);
> - seq_printf(m, "%pa..%pa\n", &reg->base, &end);
> + seq_printf(m, "%d:\t", i);
> + seq_printf(m, "%pa..%pa\t", &reg->base, &end);
> + seq_printf(m, "0x%x\t", reg->flags);
> + seq_printf(m, "0x%x\n", memblock_get_region_node(reg));

Please use "%4d" for nid.

> }
> return 0;
> }
> --
> 2.34.1
>

--
Sincerely yours,
Mike.