Re: [PATCH v3 04/16] mm: Split out internal page_alloc.h

From: sashiko-bot

Date: Mon Jun 29 2026 - 10:30:12 EST


Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Missing inclusion of `page_alloc.h` causes build failures for multiple configurations.
--

commit 34a7c3e538f8ec840a6b68715addef408e469ff0
Author: Brendan Jackman <jackmanb@xxxxxxxxxx>

mm: Split out internal page_alloc.h

internal.h is a bit bloated, seems like time for a page_alloc.h.
This moves definitions supporting mm/page_alloc.c into the new header.

Link: https://lore.kernel.org/all/41e92bab-6882-401a-8de9-154adbdcfb36@xxxxxxxxxx/

> diff --git a/mm/internal.h b/mm/internal.h
> index 8ce59c5664497..c22284f04fc9e 100644
> --- a/mm/internal.h
> +++ b/mm/internal.h
[ ... ]
> -static inline unsigned int buddy_order(struct page *page)
> -{
> - /* PageBuddy() must be checked by the caller */
> - return page_private(page);
> -}

[Severity: Low]
Will this cause a build failure when shuffle page allocator or page reporting
features are enabled?

It looks like shuffle_valid_page() in mm/shuffle.c and page_reporting_drain()
in mm/page_reporting.c use buddy_order() but don't include the new
page_alloc.h.

[ ... ]
> -extern void __free_pages_core(struct page *page, unsigned int order,
> - enum meminit_context context);

[Severity: Low]
Does mm/kmsan/init.c need to include page_alloc.h now?

It seems do_collection() uses __free_pages_core() and might fail to build
when the kernel is configured for kmsan if the header is missing.

[ ... ]
> -#define ALLOC_CMA 0x80 /* allow allocations from CMA areas */

[Severity: Low]
Could this break the build for migration and page reporting configurations?

I am noticing that migrate_balanced_pgdat() in mm/migrate.c and
page_reporting_process_zone() in mm/page_reporting.c use ALLOC_CMA but neither
of these files appears to include page_alloc.h.

--
Sashiko AI review · https://sashiko.dev/#/patchset/20260629-alloc-trylock-v3-0-57bef0eadbc2@xxxxxxxxxx?part=4