linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: Yuwei Guan <ssawgyw@gmail.com>
Cc: akpm@linux-foundation.org, tsahu@linux.ibm.com,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] memblock: Add flags and nid info in memblock debugfs
Date: Wed, 17 May 2023 16:43:51 +0300	[thread overview]
Message-ID: <ZGTaF801Pjs+M48x@kernel.org> (raw)
In-Reply-To: <20230517025747.230-1-ssawgyw@gmail.com>

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.


      parent reply	other threads:[~2023-05-17 13:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-17  2:57 Yuwei Guan
2023-05-17  6:07 ` Anshuman Khandual
2023-05-17 13:42   ` Mike Rapoport
2023-05-18  5:58     ` Yuwei Guan
2023-05-17 13:43 ` Mike Rapoport [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZGTaF801Pjs+M48x@kernel.org \
    --to=rppt@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ssawgyw@gmail.com \
    --cc=tsahu@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox