linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/page_alloc: Fix incorrect PGFREE and PGALLOC for high-order page
@ 2022-10-06 10:15 Yafang Shao
  2022-10-06 14:33 ` Mel Gorman
  2022-10-08  2:55 ` Miaohe Lin
  0 siblings, 2 replies; 3+ messages in thread
From: Yafang Shao @ 2022-10-06 10:15 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, Yafang Shao, Mel Gorman

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>
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;
-- 
1.8.3.1



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

end of thread, other threads:[~2022-10-08  2:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-06 10:15 [PATCH] mm/page_alloc: Fix incorrect PGFREE and PGALLOC for high-order page Yafang Shao
2022-10-06 14:33 ` Mel Gorman
2022-10-08  2:55 ` Miaohe Lin

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).