Re: [PATCH] mm,vmstat: correct pagetypeinfo statistics when show

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
> ---
>  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
> 




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux