linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm,vmstat: correct pagetypeinfo statistics when show
@ 2019-05-10 12:36 Bruce ZHANG
  2019-05-10 18:49 ` Daniel Jordan
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Bruce ZHANG @ 2019-05-10 12:36 UTC (permalink / raw)
  To: akpm; +Cc: guro, mhocko, vbabka, jannh, linux-mm

The "Free pages count per migrate type at order" are shown with the
order from 0 ~ (MAX_ORDER-1), while "Page block order" just print
pageblock_order. If the macro CONFIG_HUGETLB_PAGE is defined, the
pageblock_order may not be equal to (MAX_ORDER-1).

Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
---
 mm/vmstat.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/vmstat.c b/mm/vmstat.c
index 6389e87..b0089cf 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -1430,8 +1430,8 @@ static int pagetypeinfo_show(struct seq_file *m, void *arg)
 	if (!node_state(pgdat->node_id, N_MEMORY))
 		return 0;
 
-	seq_printf(m, "Page block order: %d\n", pageblock_order);
-	seq_printf(m, "Pages per block:  %lu\n", pageblock_nr_pages);
+	seq_printf(m, "Page block order: %d\n", MAX_ORDER - 1);
+	seq_printf(m, "Pages per block:  %lu\n", MAX_ORDER_NR_PAGES);
 	seq_putc(m, '\n');
 	pagetypeinfo_showfree(m, pgdat);
 	pagetypeinfo_showblockcount(m, pgdat);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm,vmstat: correct pagetypeinfo statistics when show
  2019-05-10 12:36 [PATCH] mm,vmstat: correct pagetypeinfo statistics when show Bruce ZHANG
@ 2019-05-10 18:49 ` Daniel Jordan
  2019-05-13  8:53   ` Mel Gorman
  2019-05-10 20:13 ` Daniel Jordan
  2019-05-10 21:24 ` Daniel Jordan
  2 siblings, 1 reply; 6+ messages in thread
From: Daniel Jordan @ 2019-05-10 18:49 UTC (permalink / raw)
  To: Bruce ZHANG; +Cc: akpm, guro, mhocko, vbabka, jannh, linux-mm, mgorman

On Fri, May 10, 2019 at 12:36:48PM +0000, Bruce ZHANG wrote:
> The "Free pages count per migrate type at order" are shown with the
> order from 0 ~ (MAX_ORDER-1), while "Page block order" just print
> pageblock_order. If the macro CONFIG_HUGETLB_PAGE is defined, the
> pageblock_order may not be equal to (MAX_ORDER-1).

All of this is true, but why do you think it's wrong?

It makes sense that "Page block order" corresponds to pageblock_order,
regardless of whether pageblock_order == MAX_ORDER-1.

Cc Mel, who added these two lines.

> Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
> ---
>  mm/vmstat.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/vmstat.c b/mm/vmstat.c
> index 6389e87..b0089cf 100644
> --- a/mm/vmstat.c
> +++ b/mm/vmstat.c
> @@ -1430,8 +1430,8 @@ static int pagetypeinfo_show(struct seq_file *m, void *arg)
>  	if (!node_state(pgdat->node_id, N_MEMORY))
>  		return 0;
>  
> -	seq_printf(m, "Page block order: %d\n", pageblock_order);
> -	seq_printf(m, "Pages per block:  %lu\n", pageblock_nr_pages);
> +	seq_printf(m, "Page block order: %d\n", MAX_ORDER - 1);
> +	seq_printf(m, "Pages per block:  %lu\n", MAX_ORDER_NR_PAGES);
>  	seq_putc(m, '\n');
>  	pagetypeinfo_showfree(m, pgdat);
>  	pagetypeinfo_showblockcount(m, pgdat);
> -- 
> 1.9.1
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm,vmstat: correct pagetypeinfo statistics when show
  2019-05-10 12:36 [PATCH] mm,vmstat: correct pagetypeinfo statistics when show Bruce ZHANG
  2019-05-10 18:49 ` Daniel Jordan
@ 2019-05-10 20:13 ` Daniel Jordan
  2019-05-10 21:24 ` Daniel Jordan
  2 siblings, 0 replies; 6+ messages in thread
From: Daniel Jordan @ 2019-05-10 20:13 UTC (permalink / raw)
  To: Bruce ZHANG; +Cc: akpm, guro, mhocko, vbabka, jannh, linux-mm, mgorman

On Fri, May 10, 2019 at 12:36:48PM +0000, Bruce ZHANG wrote:
> The "Free pages count per migrate type at order" are shown with the
> order from 0 ~ (MAX_ORDER-1), while "Page block order" just print
> pageblock_order. If the macro CONFIG_HUGETLB_PAGE is defined, the
> pageblock_order may not be equal to (MAX_ORDER-1).

All of this is true, but why is it wrong?                            
                                                                                 
It makes sense that "Page block order" corresponds to pageblock_order,           
regardless of whether pageblock_order == MAX_ORDER-1.                            
                                                                                 
Cc Mel, who added these two lines.

> Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
> ---
>  mm/vmstat.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/vmstat.c b/mm/vmstat.c
> index 6389e87..b0089cf 100644
> --- a/mm/vmstat.c
> +++ b/mm/vmstat.c
> @@ -1430,8 +1430,8 @@ static int pagetypeinfo_show(struct seq_file *m, void *arg)
>  	if (!node_state(pgdat->node_id, N_MEMORY))
>  		return 0;
>  
> -	seq_printf(m, "Page block order: %d\n", pageblock_order);
> -	seq_printf(m, "Pages per block:  %lu\n", pageblock_nr_pages);
> +	seq_printf(m, "Page block order: %d\n", MAX_ORDER - 1);
> +	seq_printf(m, "Pages per block:  %lu\n", MAX_ORDER_NR_PAGES);
>  	seq_putc(m, '\n');
>  	pagetypeinfo_showfree(m, pgdat);
>  	pagetypeinfo_showblockcount(m, pgdat);
> -- 
> 1.9.1
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm,vmstat: correct pagetypeinfo statistics when show
  2019-05-10 12:36 [PATCH] mm,vmstat: correct pagetypeinfo statistics when show Bruce ZHANG
  2019-05-10 18:49 ` Daniel Jordan
  2019-05-10 20:13 ` Daniel Jordan
@ 2019-05-10 21:24 ` Daniel Jordan
  2 siblings, 0 replies; 6+ messages in thread
From: Daniel Jordan @ 2019-05-10 21:24 UTC (permalink / raw)
  To: Bruce ZHANG; +Cc: akpm, guro, mhocko, vbabka, jannh, linux-mm, mgorman

On Fri, May 10, 2019 at 12:36:48PM +0000, Bruce ZHANG wrote:
> The "Free pages count per migrate type at order" are shown with the
> order from 0 ~ (MAX_ORDER-1), while "Page block order" just print
> pageblock_order. If the macro CONFIG_HUGETLB_PAGE is defined, the
> pageblock_order may not be equal to (MAX_ORDER-1).

All of this is true, but why is it wrong?                                        
                                                                                 
It makes sense that "Page block order" corresponds to pageblock_order,           
regardless of whether pageblock_order == MAX_ORDER-1.                            
                                                                                 
Cc Mel, who added these two lines.

> Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
> ---
>  mm/vmstat.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/vmstat.c b/mm/vmstat.c
> index 6389e87..b0089cf 100644
> --- a/mm/vmstat.c
> +++ b/mm/vmstat.c
> @@ -1430,8 +1430,8 @@ static int pagetypeinfo_show(struct seq_file *m, void *arg)
>  	if (!node_state(pgdat->node_id, N_MEMORY))
>  		return 0;
>  
> -	seq_printf(m, "Page block order: %d\n", pageblock_order);
> -	seq_printf(m, "Pages per block:  %lu\n", pageblock_nr_pages);
> +	seq_printf(m, "Page block order: %d\n", MAX_ORDER - 1);
> +	seq_printf(m, "Pages per block:  %lu\n", MAX_ORDER_NR_PAGES);
>  	seq_putc(m, '\n');
>  	pagetypeinfo_showfree(m, pgdat);
>  	pagetypeinfo_showblockcount(m, pgdat);
> -- 
> 1.9.1
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm,vmstat: correct pagetypeinfo statistics when show
  2019-05-10 18:49 ` Daniel Jordan
@ 2019-05-13  8:53   ` Mel Gorman
  2019-05-17  6:44     ` Anshuman Khandual
  0 siblings, 1 reply; 6+ messages in thread
From: Mel Gorman @ 2019-05-13  8:53 UTC (permalink / raw)
  To: Daniel Jordan; +Cc: Bruce ZHANG, akpm, guro, mhocko, vbabka, jannh, linux-mm

On Fri, May 10, 2019 at 02:49:00PM -0400, Daniel Jordan wrote:
> On Fri, May 10, 2019 at 12:36:48PM +0000, Bruce ZHANG wrote:
> > The "Free pages count per migrate type at order" are shown with the
> > order from 0 ~ (MAX_ORDER-1), while "Page block order" just print
> > pageblock_order. If the macro CONFIG_HUGETLB_PAGE is defined, the
> > pageblock_order may not be equal to (MAX_ORDER-1).
> 
> All of this is true, but why do you think it's wrong?
> 

Indeed, why is this wrong?

> It makes sense that "Page block order" corresponds to pageblock_order,
> regardless of whether pageblock_order == MAX_ORDER-1.
> 

Page block order is related to the PMD huge page size, it's not directly
related to MAX_ORDER other than MAX_ORDER is larger than
pageblock_order.

> Cc Mel, who added these two lines.
> 
> > Signed-off-by: Zhang Bo <bo.zhang@nxp.com>

What's there is correct so unless there is a great explanation as to why
it should be different;

Naked-by: Mel Gorman <mgorman@techsingularity.net>

-- 
Mel Gorman
SUSE Labs


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm,vmstat: correct pagetypeinfo statistics when show
  2019-05-13  8:53   ` Mel Gorman
@ 2019-05-17  6:44     ` Anshuman Khandual
  0 siblings, 0 replies; 6+ messages in thread
From: Anshuman Khandual @ 2019-05-17  6:44 UTC (permalink / raw)
  To: Mel Gorman, Daniel Jordan
  Cc: Bruce ZHANG, akpm, guro, mhocko, vbabka, jannh, linux-mm



On 05/13/2019 02:23 PM, Mel Gorman wrote:
> On Fri, May 10, 2019 at 02:49:00PM -0400, Daniel Jordan wrote:
>> On Fri, May 10, 2019 at 12:36:48PM +0000, Bruce ZHANG wrote:
>>> The "Free pages count per migrate type at order" are shown with the
>>> order from 0 ~ (MAX_ORDER-1), while "Page block order" just print
>>> pageblock_order. If the macro CONFIG_HUGETLB_PAGE is defined, the
>>> pageblock_order may not be equal to (MAX_ORDER-1).
>>
>> All of this is true, but why do you think it's wrong?
>>
> 
> Indeed, why is this wrong?
> 
>> It makes sense that "Page block order" corresponds to pageblock_order,
>> regardless of whether pageblock_order == MAX_ORDER-1.
>>
> 
> Page block order is related to the PMD huge page size, it's not directly
> related to MAX_ORDER other than MAX_ORDER is larger than
> pageblock_order.

Right.

> 
>> Cc Mel, who added these two lines.
>>
>>> Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
> 
> What's there is correct so unless there is a great explanation as to why
> it should be different;

Agreed.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-05-17  6:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-10 12:36 [PATCH] mm,vmstat: correct pagetypeinfo statistics when show Bruce ZHANG
2019-05-10 18:49 ` Daniel Jordan
2019-05-13  8:53   ` Mel Gorman
2019-05-17  6:44     ` Anshuman Khandual
2019-05-10 20:13 ` Daniel Jordan
2019-05-10 21:24 ` Daniel Jordan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).