Commit c25872c3 authored by Huan Yang's avatar Huan Yang Committed by yipeng xiang
Browse files

UPSTREAM: mm: page_alloc: simpify page del and expand

When page del from buddy and need expand, it will account free_pages in
zone's migratetype.

The current way is to subtract the page number of the current order when
deleting, and then add it back when expanding.

This is unnecessary, as when migrating the same type, we can directly
record the difference between the high-order pages and the expand added,
and then subtract it directly.

This patch merge that, only when del and expand done, then account
free_pages.

Link: https://lkml.kernel.org/r/20240826064048.187790-1-link@vivo.com


Signed-off-by: default avatarHuan Yang <link@vivo.com>
Reviewed-by: default avatarVlastimil Babka <vbabka@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>

Bug: 420836317
Bug: 429525621
(cherry picked from commit 94deaf69)
Change-Id: I26196bc41cbf0f64dc9a9bc2249c9c814ca055d0
Signed-off-by: default avataryipeng xiang <yipengxiang@honor.corp-partner.google.com>
parent 15aa8291
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment