Factor out the splitting of non-compound page from make_alloc_exact() and split_page() into a new helper function __split_page(). Signed-off-by: Kefeng Wang --- mm/page_alloc.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 949b01f293d4..646a6c2293f9 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3042,6 +3042,15 @@ void free_unref_folios(struct folio_batch *folios) folio_batch_reinit(folios); } +static void __split_page(struct page *page, unsigned int order) +{ + VM_BUG_ON_PAGE(PageCompound(page), page); + + split_page_owner(page, order, 0); + pgalloc_tag_split(page_folio(page), order, 0); + split_page_memcg(page, order); +} + /* * split_page takes a non-compound higher-order page, and splits it into * n (1<