]> Git Repo - J-linux.git/commitdiff
mm/page_alloc: fix incorrect PGFREE and PGALLOC for high-order page
authorYafang Shao <[email protected]>
Thu, 6 Oct 2022 10:15:40 +0000 (10:15 +0000)
committerAndrew Morton <[email protected]>
Thu, 13 Oct 2022 01:51:51 +0000 (18:51 -0700)
PGFREE and PGALLOC represent the number of freed and allocated pages.  So
the page order must be considered.

Link: https://lkml.kernel.org/r/[email protected]
Fixes: 44042b449872 ("mm/page_alloc: allow high-order pages to be stored on the per-cpu lists")
Signed-off-by: Yafang Shao <[email protected]>
Acked-by: Mel Gorman <[email protected]>
Reviewed-by: Miaohe Lin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
mm/page_alloc.c

index 059f6946832fa9279f39391950dcbec0e433a929..8e9b7f08a32ce8d09e1dcbf397118c52d29dfabd 100644 (file)
@@ -3446,7 +3446,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;
@@ -3803,7 +3803,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;
This page took 0.063679 seconds and 4 git commands to generate.