linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Miaohe Lin <linmiaohe@huawei.com>
To: Yafang Shao <laoar.shao@gmail.com>
Cc: <linux-mm@kvack.org>, Mel Gorman <mgorman@techsingularity.net>,
	<akpm@linux-foundation.org>
Subject: Re: [PATCH] mm/page_alloc: Fix incorrect PGFREE and PGALLOC for high-order page
Date: Sat, 8 Oct 2022 10:55:38 +0800	[thread overview]
Message-ID: <dd4e3636-601c-0dde-180d-93b71b1be5ff@huawei.com> (raw)
In-Reply-To: <20221006101540.40686-1-laoar.shao@gmail.com>

On 2022/10/6 18:15, Yafang Shao wrote:
> PGFREE and PGALLOC represent the number of freed and allocated pages.
> So the page order must be considered.
> 
> Fixes: 44042b449872 ("mm/page_alloc: allow high-order pages to be stored on the per-cpu lists")
> Signed-off-by: Yafang Shao <laoar.shao@gmail.com>

LGTM. Thanks for fixing.

Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>

Thanks,
Miaohe Lin

> Cc: Mel Gorman <mgorman@techsingularity.net>
> ---
>  mm/page_alloc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index e5486d4..3c0ee3b 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -3440,7 +3440,7 @@ static void free_unref_page_commit(struct zone *zone, struct per_cpu_pages *pcp,
>  	int pindex;
>  	bool free_high;
>  
> -	__count_vm_event(PGFREE);
> +	__count_vm_events(PGFREE, 1 << order);
>  	pindex = order_to_pindex(migratetype, order);
>  	list_add(&page->pcp_list, &pcp->lists[pindex]);
>  	pcp->count += 1 << order;
> @@ -3808,7 +3808,7 @@ static struct page *rmqueue_pcplist(struct zone *preferred_zone,
>  	pcp_spin_unlock_irqrestore(pcp, flags);
>  	pcp_trylock_finish(UP_flags);
>  	if (page) {
> -		__count_zid_vm_events(PGALLOC, page_zonenum(page), 1);
> +		__count_zid_vm_events(PGALLOC, page_zonenum(page), 1 << order);
>  		zone_statistics(preferred_zone, zone, 1);
>  	}
>  	return page;
> 



      parent reply	other threads:[~2022-10-08  2:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-06 10:15 Yafang Shao
2022-10-06 14:33 ` Mel Gorman
2022-10-08  2:55 ` Miaohe Lin [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=dd4e3636-601c-0dde-180d-93b71b1be5ff@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=laoar.shao@gmail.com \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    /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