]> Gentwo Git Trees - linux/.git/commit
mm/page_alloc: batch page freeing in decay_pcp_high
authorJoshua Hahn <joshua.hahnjy@gmail.com>
Tue, 14 Oct 2025 14:50:09 +0000 (07:50 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 17 Nov 2025 01:28:04 +0000 (17:28 -0800)
commitfc4b909c368f3a7b08c895dd5926476b58e85312
tree59f623d636cc57d710d3dcc2d6fa50fd914e5998
parent0acc67c4030c39f39ac90413cc5d0abddd3a9527
mm/page_alloc: batch page freeing in decay_pcp_high

It is possible for pcp->count - pcp->high to exceed pcp->batch by a lot.
When this happens, we should perform batching to ensure that
free_pcppages_bulk isn't called with too many pages to free at once and
starve out other threads that need the pcp or zone lock.

Since we are still only freeing the difference between the initial
pcp->count and pcp->high values, there should be no change to how many
pages are freed.

Link: https://lkml.kernel.org/r/20251014145011.3427205-3-joshua.hahnjy@gmail.com
Signed-off-by: Joshua Hahn <joshua.hahnjy@gmail.com>
Suggested-by: Chris Mason <clm@fb.com>
Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Co-developed-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Brendan Jackman <jackmanb@google.com>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: Michal Hocko <mhocko@suse.com>
Cc: SeongJae Park <sj@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/page_alloc.c