Re: [PATCH] mm/page_alloc: drop a misleading __always_inline
From: Vlastimil Babka (SUSE)
Date: Fri May 22 2026 - 03:43:58 EST
On 5/18/26 01:37, Brendan Jackman wrote:
> get_pfnblock_migratetype() is called from outside page_alloc.c, so it
> cannot always be inlined. Remove the annotation to avoid misleading
> readers.
>
> At least in my minimal config, with GCC, this doesn't change
> mm/page_alloc.o at all.
>
> Suggested-by: Vlastimil Babka <vbabka@xxxxxxxxxx>
> Link: https://lore.kernel.org/all/016c8bef-57ef-44ef-bf60-86dbfd368dcd@xxxxxxxxxx/
> Signed-off-by: Brendan Jackman <jackmanb@xxxxxxxxxx>
Reviewed-by: Vlastimil Babka (SUSE) <vbabka@xxxxxxxxxx>
> ---
> mm/page_alloc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index e262d1316259d..be7f5671d421c 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -434,7 +434,7 @@ bool get_pfnblock_bit(const struct page *page, unsigned long pfn,
> * Use get_pfnblock_migratetype() if caller already has both @page and @pfn
> * to save a call to page_to_pfn().
> */
> -__always_inline enum migratetype
> +enum migratetype
> get_pfnblock_migratetype(const struct page *page, unsigned long pfn)
> {
> unsigned long mask = MIGRATETYPE_AND_ISO_MASK;
>
> ---
> base-commit: 0cec77cfd5314c0b3b03530abe1a4b32e991f639
> change-id: 20260517-b4-drop-always-inline-17702081c2aa
>
> Best regards,