Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/page_alloc: drop a misleading __always_inline
@ 2026-05-17 23:37 Brendan Jackman
  2026-05-18  0:10 ` Zi Yan
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Brendan Jackman @ 2026-05-17 23:37 UTC (permalink / raw)
  To: Andrew Morton, Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Johannes Weiner, Zi Yan
  Cc: linux-mm, linux-kernel, Brendan Jackman

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@kernel.org>
Link: https://lore.kernel.org/all/016c8bef-57ef-44ef-bf60-86dbfd368dcd@kernel.org/
Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
 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,
-- 
Brendan Jackman <jackmanb@google.com>



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm/page_alloc: drop a misleading __always_inline
  2026-05-17 23:37 [PATCH] mm/page_alloc: drop a misleading __always_inline Brendan Jackman
@ 2026-05-18  0:10 ` Zi Yan
  2026-05-19  1:33 ` SeongJae Park
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Zi Yan @ 2026-05-18  0:10 UTC (permalink / raw)
  To: Brendan Jackman
  Cc: Andrew Morton, Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Johannes Weiner, linux-mm, linux-kernel

On 18 May 2026, at 7: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.

I probably did a copy-paste last time.

> At least in my minimal config, with GCC, this doesn't change
> mm/page_alloc.o at all.
>
> Suggested-by: Vlastimil Babka <vbabka@kernel.org>
> Link: https://lore.kernel.org/all/016c8bef-57ef-44ef-bf60-86dbfd368dcd@kernel.org/
> Signed-off-by: Brendan Jackman <jackmanb@google.com>
> ---
>  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;

LGTM. Thanks.

Reviewed-by: Zi Yan <ziy@nvidia.com>
>
> ---
> base-commit: 0cec77cfd5314c0b3b03530abe1a4b32e991f639
> change-id: 20260517-b4-drop-always-inline-17702081c2aa
>
> Best regards,
> -- 
> Brendan Jackman <jackmanb@google.com>


Best Regards,
Yan, Zi


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm/page_alloc: drop a misleading __always_inline
  2026-05-17 23:37 [PATCH] mm/page_alloc: drop a misleading __always_inline Brendan Jackman
  2026-05-18  0:10 ` Zi Yan
@ 2026-05-19  1:33 ` SeongJae Park
  2026-05-22  7:41 ` Vlastimil Babka (SUSE)
  2026-05-22  8:19 ` Vishal Moola
  3 siblings, 0 replies; 5+ messages in thread
From: SeongJae Park @ 2026-05-19  1:33 UTC (permalink / raw)
  To: Brendan Jackman
  Cc: SeongJae Park, Andrew Morton, Vlastimil Babka, Suren Baghdasaryan,
	Michal Hocko, Johannes Weiner, Zi Yan, linux-mm, linux-kernel

On Sun, 17 May 2026 23:37:05 +0000 Brendan Jackman <jackmanb@google.com> wrote:

> get_pfnblock_migratetype() is called from outside page_alloc.c, so it
> cannot always be inlined. Remove the annotation to avoid misleading
> readers.

Makes sense.

> 
> At least in my minimal config, with GCC, this doesn't change
> mm/page_alloc.o at all.

Same on my setup.

> 
> Suggested-by: Vlastimil Babka <vbabka@kernel.org>
> Link: https://lore.kernel.org/all/016c8bef-57ef-44ef-bf60-86dbfd368dcd@kernel.org/
> Signed-off-by: Brendan Jackman <jackmanb@google.com>

Reviewed-by: SeongJae Park <sj@kernel.org>


Thanks,
SJ

[...]


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm/page_alloc: drop a misleading __always_inline
  2026-05-17 23:37 [PATCH] mm/page_alloc: drop a misleading __always_inline Brendan Jackman
  2026-05-18  0:10 ` Zi Yan
  2026-05-19  1:33 ` SeongJae Park
@ 2026-05-22  7:41 ` Vlastimil Babka (SUSE)
  2026-05-22  8:19 ` Vishal Moola
  3 siblings, 0 replies; 5+ messages in thread
From: Vlastimil Babka (SUSE) @ 2026-05-22  7:41 UTC (permalink / raw)
  To: Brendan Jackman, Andrew Morton, Suren Baghdasaryan, Michal Hocko,
	Johannes Weiner, Zi Yan
  Cc: linux-mm, linux-kernel

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@kernel.org>
> Link: https://lore.kernel.org/all/016c8bef-57ef-44ef-bf60-86dbfd368dcd@kernel.org/
> Signed-off-by: Brendan Jackman <jackmanb@google.com>

Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>

> ---
>  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,



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm/page_alloc: drop a misleading __always_inline
  2026-05-17 23:37 [PATCH] mm/page_alloc: drop a misleading __always_inline Brendan Jackman
                   ` (2 preceding siblings ...)
  2026-05-22  7:41 ` Vlastimil Babka (SUSE)
@ 2026-05-22  8:19 ` Vishal Moola
  3 siblings, 0 replies; 5+ messages in thread
From: Vishal Moola @ 2026-05-22  8:19 UTC (permalink / raw)
  To: Brendan Jackman
  Cc: Andrew Morton, Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Johannes Weiner, Zi Yan, linux-mm, linux-kernel

On Sun, May 17, 2026 at 11:37:05PM +0000, 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@kernel.org>
> Link: https://lore.kernel.org/all/016c8bef-57ef-44ef-bf60-86dbfd368dcd@kernel.org/
> Signed-off-by: Brendan Jackman <jackmanb@google.com>
> ---

Reviewed-by: Vishal Moola <vishal.moola@gmail.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-05-22  8:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-17 23:37 [PATCH] mm/page_alloc: drop a misleading __always_inline Brendan Jackman
2026-05-18  0:10 ` Zi Yan
2026-05-19  1:33 ` SeongJae Park
2026-05-22  7:41 ` Vlastimil Babka (SUSE)
2026-05-22  8:19 ` Vishal Moola

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox