* [PATCH] memblock: Update nid info in memblock debugfs
@ 2023-05-29 6:20 Yuwei Guan
2023-06-01 5:21 ` Mike Rapoport
0 siblings, 1 reply; 3+ messages in thread
From: Yuwei Guan @ 2023-05-29 6:20 UTC (permalink / raw)
To: rppt, akpm, wangkefeng.wang, anshuman.khandual
Cc: linux-mm, linux-kernel, Yuwei Guan
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) <rppt@kernel.org>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Yuwei Guan <ssawgyw@gmail.com>
---
mm/memblock.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/mm/memblock.c b/mm/memblock.c
index c5c80d9bcea3..3d449aaba052 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -2169,17 +2169,21 @@ static int memblock_debug_show(struct seq_file *m, void *private)
{
struct memblock_type *type = m->private;
struct memblock_region *reg;
- int i, j;
+ int i, j, nid;
unsigned int count = ARRAY_SIZE(flagname);
phys_addr_t end;
for (i = 0; i < type->cnt; i++) {
reg = &type->regions[i];
end = reg->base + reg->size - 1;
+ nid = memblock_get_region_node(reg);
seq_printf(m, "%4d: ", i);
seq_printf(m, "%pa..%pa ", ®->base, &end);
- seq_printf(m, "%4d ", memblock_get_region_node(reg));
+ if (nid != MAX_NUMNODES)
+ seq_printf(m, "%4d ", nid);
+ else
+ seq_printf(m, "%4c ", 'x');
if (reg->flags) {
for (j = 0; j < count; j++) {
if (reg->flags & (1U << j)) {
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] memblock: Update nid info in memblock debugfs
2023-05-29 6:20 [PATCH] memblock: Update nid info in memblock debugfs Yuwei Guan
@ 2023-06-01 5:21 ` Mike Rapoport
2023-06-01 12:33 ` Yuwei Guan
0 siblings, 1 reply; 3+ messages in thread
From: Mike Rapoport @ 2023-06-01 5:21 UTC (permalink / raw)
To: Yuwei Guan
Cc: akpm, wangkefeng.wang, anshuman.khandual, linux-mm, linux-kernel
On Mon, May 29, 2023 at 02:20:02PM +0800, Yuwei Guan wrote:
> 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) <rppt@kernel.org>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> Signed-off-by: Yuwei Guan <ssawgyw@gmail.com>
I believe this could use Co-developed-by tags.
Please take a look at Documentation/process/submitting-patches.rst
> ---
> mm/memblock.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/mm/memblock.c b/mm/memblock.c
> index c5c80d9bcea3..3d449aaba052 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -2169,17 +2169,21 @@ static int memblock_debug_show(struct seq_file *m, void *private)
> {
> struct memblock_type *type = m->private;
> struct memblock_region *reg;
> - int i, j;
> + int i, j, nid;
> unsigned int count = ARRAY_SIZE(flagname);
> phys_addr_t end;
>
> for (i = 0; i < type->cnt; i++) {
> reg = &type->regions[i];
> end = reg->base + reg->size - 1;
> + nid = memblock_get_region_node(reg);
>
> seq_printf(m, "%4d: ", i);
> seq_printf(m, "%pa..%pa ", ®->base, &end);
> - seq_printf(m, "%4d ", memblock_get_region_node(reg));
> + if (nid != MAX_NUMNODES)
> + seq_printf(m, "%4d ", nid);
> + else
> + seq_printf(m, "%4c ", 'x');
> if (reg->flags) {
> for (j = 0; j < count; j++) {
> if (reg->flags & (1U << j)) {
> --
> 2.34.1
>
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] memblock: Update nid info in memblock debugfs
2023-06-01 5:21 ` Mike Rapoport
@ 2023-06-01 12:33 ` Yuwei Guan
0 siblings, 0 replies; 3+ messages in thread
From: Yuwei Guan @ 2023-06-01 12:33 UTC (permalink / raw)
To: Mike Rapoport
Cc: akpm, wangkefeng.wang, anshuman.khandual, linux-mm, linux-kernel
Mike Rapoport <rppt@kernel.org> 于2023年6月1日周四 13:21写道:
>
> On Mon, May 29, 2023 at 02:20:02PM +0800, Yuwei Guan wrote:
> > 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) <rppt@kernel.org>
> > Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> > Signed-off-by: Yuwei Guan <ssawgyw@gmail.com>
>
> I believe this could use Co-developed-by tags.
> Please take a look at Documentation/process/submitting-patches.rst
>
Hi Mike,
Thanks, I will look into it, and resend this patch soon.
> > ---
> > mm/memblock.c | 8 ++++++--
> > 1 file changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/mm/memblock.c b/mm/memblock.c
> > index c5c80d9bcea3..3d449aaba052 100644
> > --- a/mm/memblock.c
> > +++ b/mm/memblock.c
> > @@ -2169,17 +2169,21 @@ static int memblock_debug_show(struct seq_file *m, void *private)
> > {
> > struct memblock_type *type = m->private;
> > struct memblock_region *reg;
> > - int i, j;
> > + int i, j, nid;
> > unsigned int count = ARRAY_SIZE(flagname);
> > phys_addr_t end;
> >
> > for (i = 0; i < type->cnt; i++) {
> > reg = &type->regions[i];
> > end = reg->base + reg->size - 1;
> > + nid = memblock_get_region_node(reg);
> >
> > seq_printf(m, "%4d: ", i);
> > seq_printf(m, "%pa..%pa ", ®->base, &end);
> > - seq_printf(m, "%4d ", memblock_get_region_node(reg));
> > + if (nid != MAX_NUMNODES)
> > + seq_printf(m, "%4d ", nid);
> > + else
> > + seq_printf(m, "%4c ", 'x');
> > if (reg->flags) {
> > for (j = 0; j < count; j++) {
> > if (reg->flags & (1U << j)) {
> > --
> > 2.34.1
> >
>
> --
> Sincerely yours,
> Mike.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-06-01 12:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-29 6:20 [PATCH] memblock: Update nid info in memblock debugfs Yuwei Guan
2023-06-01 5:21 ` Mike Rapoport
2023-06-01 12:33 ` Yuwei Guan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.