From: Joshua Hahn Date: Tue, 14 Oct 2025 19:28:22 +0000 (-0700) Subject: mm-page_alloc-batch-page-freeing-in-free_frozen_page_commit-fix X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=4c46f3786a687f93dfaaf2d916f4b4015f6cfe82;p=users%2Fjedix%2Flinux-maple.git mm-page_alloc-batch-page-freeing-in-free_frozen_page_commit-fix checking for 0-ness is sufficient, per Vlastimil Since to_free and pcp->count cannot become negative, make the checks into an equality check instead. Link: https://lkml.kernel.org/r/20251014192827.851389-1-joshua.hahnjy@gmail.com Signed-off-by: Joshua Hahn Reviewed-by: Vlastimil Babka Cc: Brendan Jackman Cc: Chris Mason Cc: Johannes Weiner Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: SeongJae Park Cc: Suren Baghdasaryan Cc: Zi Yan Signed-off-by: Andrew Morton --- diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 58cb279928a5..0155a66d7367 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2884,7 +2884,7 @@ static bool free_frozen_page_commit(struct zone *zone, free_pcppages_bulk(zone, to_free_batched, pcp, pindex); to_free -= to_free_batched; - if (to_free <= 0 || pcp->count <= 0) + if (to_free == 0 || pcp->count == 0) break; pcp_spin_unlock(pcp);