Re: [PATCH v2 12/13] mm: Move __alloc_pages() to mm/internal.h
From: David Hildenbrand (Arm)
Date: Mon Jun 22 2026 - 10:35:31 EST
On 6/22/26 15:07, Brendan Jackman wrote:
> On Mon Jun 22, 2026 at 12:24 PM UTC, David Hildenbrand (Arm) wrote:
>> On 6/22/26 12:01, Brendan Jackman wrote:
>>> It's no longer used outside of mm/.
>>>
>>> Since this means __alloc_pages_noprof() is no longer visible from gfp.h,
>>> this also means moving the definition of alloc_pages_node_noprof into
>>> the .c file.
>>>
>>> Signed-off-by: Brendan Jackman <jackmanb@xxxxxxxxxx>
>>> ---
>>> Documentation/admin-guide/cgroup-v1/cpusets.rst | 2 +-
>>> Documentation/admin-guide/mm/transhuge.rst | 2 +-
>>> include/linux/gfp.h | 16 +---------------
>>> mm/internal.h | 4 ++++
>>> mm/page_alloc.c | 11 +++++++++++
>>> 5 files changed, 18 insertions(+), 17 deletions(-)
>>
>> Do we want some mm/page_alloc.h , to start splitting up mm/internal.h
>
> Don't see why not, if people are on board I'm happy to do that for v3.
>
> (I just realised I put __alloc_pages_noprof() at the bottom of the file,
> while it should be next to __alloc_frozen_pages etc, should fix that in
> case we don't end up going for the separated header).
>
> So what would go in the new header...
>
> - All the buddy alloc/free entry points
> - ALLOC_ flags
> - alloc_context
> - buddy_order*(), page_is_buddy(), find_buddy_page_pfn() and
> __find_buddy_pfn()
> - post_alloc_hook(), free_pages_prepare()
> - zone_pcp_*()
> - find_suitable_fallback()
> - free_area_empty()
>
> Anything else? Or anything on that list that should stay in
> mm/internal.h?
Above looks like a decent start :) Thanks!
--
Cheers,
David