2018-05-04 13:19:32

by Michal Hocko

[permalink] [raw]
Subject: Re: [PATCH 3/3] mm/page_alloc: Fix typo in debug info of calculate_node_totalpages

On Fri 04-05-18 14:52:09, Huaisheng Ye wrote:
> realtotalpages is calculated by taking off absent_pages from
> spanned_pages in every zone.
> Debug message of calculate_node_totalpages shall accurately
> indicate that it is real totalpages to avoid ambiguity.

Is the printk actually useful? Why don't we simply remove it? You can
get the information from /proc/zoneinfo so why to litter the dmesg
output?

> Signed-off-by: Huaisheng Ye <[email protected]>
> ---
> mm/page_alloc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 1b39db4..9d57db2 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -5967,7 +5967,7 @@ static void __meminit calculate_node_totalpages(struct pglist_data *pgdat,
>
> pgdat->node_spanned_pages = totalpages;
> pgdat->node_present_pages = realtotalpages;
> - printk(KERN_DEBUG "On node %d totalpages: %lu\n", pgdat->node_id,
> + printk(KERN_DEBUG "On node %d realtotalpages: %lu\n", pgdat->node_id,
> realtotalpages);
> }
>
> --
> 1.8.3.1
>

--
Michal Hocko
SUSE Labs


2018-05-05 02:17:29

by Huaisheng HS1 Ye

[permalink] [raw]
Subject: RE: [External] Re: [PATCH 3/3] mm/page_alloc: Fix typo in debug info of calculate_node_totalpages


> On Fri 04-05-18 14:52:09, Huaisheng Ye wrote:
> > realtotalpages is calculated by taking off absent_pages from
> > spanned_pages in every zone.
> > Debug message of calculate_node_totalpages shall accurately
> > indicate that it is real totalpages to avoid ambiguity.
>
> Is the printk actually useful? Why don't we simply remove it? You can
> get the information from /proc/zoneinfo so why to litter the dmesg
> output?

Indeed, we can get the amount of pfns as spanned, present and managed
from /proc/zoneinfo after memory initialization has been finished.

But this printk is a relatively meaningful reference within dmesg log.
Especially for people who doesn't have much experience, or someone
has a plan to modify boundary of zones within free_area_init_*.

Sincerely,
Huaisheng Ye
Linux kernel | Lenovo
>
> > Signed-off-by: Huaisheng Ye <[email protected]>
> > ---
> > mm/page_alloc.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> > index 1b39db4..9d57db2 100644
> > --- a/mm/page_alloc.c
> > +++ b/mm/page_alloc.c
> > @@ -5967,7 +5967,7 @@ static void __meminit
> calculate_node_totalpages(struct pglist_data *pgdat,
> >
> > pgdat->node_spanned_pages = totalpages;
> > pgdat->node_present_pages = realtotalpages;
> > - printk(KERN_DEBUG "On node %d totalpages: %lu\n", pgdat->node_id,
> > + printk(KERN_DEBUG "On node %d realtotalpages: %lu\n",
> pgdat->node_id,
> > realtotalpages);
> > }
> >
> > --
> > 1.8.3.1


2018-05-09 07:50:45

by Michal Hocko

[permalink] [raw]
Subject: Re: [External] Re: [PATCH 3/3] mm/page_alloc: Fix typo in debug info of calculate_node_totalpages

On Sat 05-05-18 02:10:35, Huaisheng HS1 Ye wrote:
[...]
> But this printk is a relatively meaningful reference within dmesg log.
> Especially for people who doesn't have much experience, or someone
> has a plan to modify boundary of zones within free_area_init_*.

Could you be more specific please? I am not saying that the printk is
pointless but it is DEBUG and as such it doesn't give us a very good
picture.

--
Michal Hocko
SUSE Labs