Skip to content

Commit 15cd900

Browse files
laoarakpm00
authored andcommitted
mm/page_alloc: fix incorrect PGFREE and PGALLOC for high-order page
PGFREE and PGALLOC represent the number of freed and allocated pages. So the page order must be considered. Link: https://lkml.kernel.org/r/20221006101540.40686-1-laoar.shao@gmail.com Fixes: 44042b4 ("mm/page_alloc: allow high-order pages to be stored on the per-cpu lists") Signed-off-by: Yafang Shao <laoar.shao@gmail.com> Acked-by: Mel Gorman <mgorman@techsingularity.net> Reviewed-by: Miaohe Lin <linmiaohe@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 26c92d3 commit 15cd900

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mm/page_alloc.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -3446,7 +3446,7 @@ static void free_unref_page_commit(struct zone *zone, struct per_cpu_pages *pcp,
34463446
int pindex;
34473447
bool free_high;
34483448

3449-
__count_vm_event(PGFREE);
3449+
__count_vm_events(PGFREE, 1 << order);
34503450
pindex = order_to_pindex(migratetype, order);
34513451
list_add(&page->pcp_list, &pcp->lists[pindex]);
34523452
pcp->count += 1 << order;
@@ -3803,7 +3803,7 @@ static struct page *rmqueue_pcplist(struct zone *preferred_zone,
38033803
pcp_spin_unlock_irqrestore(pcp, flags);
38043804
pcp_trylock_finish(UP_flags);
38053805
if (page) {
3806-
__count_zid_vm_events(PGALLOC, page_zonenum(page), 1);
3806+
__count_zid_vm_events(PGALLOC, page_zonenum(page), 1 << order);
38073807
zone_statistics(preferred_zone, zone, 1);
38083808
}
38093809
return page;

0 commit comments

Comments
 (0)