* [PATCH] mm: Remove is_migrate_highatomic()
@ 2025-08-21 13:29 Brendan Jackman
2025-08-21 14:04 ` Zi Yan
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Brendan Jackman @ 2025-08-21 13:29 UTC (permalink / raw)
To: Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
Suren Baghdasaryan, Michal Hocko, Johannes Weiner, Zi Yan
Cc: linux-mm, linux-kernel, Brendan Jackman
There are 3 potential reasons for is_migrate_*() helpers:
1. They represent higher-level attributes of migratetypes, like
is_migrate_movable()
2. They are ifdef'd, like is_migrate_isolate().
3. For consistency with an is_migrate_*_page() helper, also like
is_migrate_isolate().
It looks like is_migrate_highatomic() was for case 3, but that was
removed in commit e0932b6c1f94 ("mm: page_alloc: consolidate free page
accounting").
So remove the indirection and go back to a simple comparison.
Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
mm/internal.h | 5 -----
mm/page_alloc.c | 2 +-
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/mm/internal.h b/mm/internal.h
index 45b725c3dc030cb22a3cb0ddb262b6300e65ed5a..45da9ff5694f628db18f740718f0a7a06c4548f0 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -1333,11 +1333,6 @@ extern const struct trace_print_flags pageflag_names[];
extern const struct trace_print_flags vmaflag_names[];
extern const struct trace_print_flags gfpflag_names[];
-static inline bool is_migrate_highatomic(enum migratetype migratetype)
-{
- return migratetype == MIGRATE_HIGHATOMIC;
-}
-
void setup_zone_pageset(struct zone *zone);
struct migration_target_control {
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index ca9e6b9633f79ff28448a6008749fa6ca2696332..baead29b3e67bb3ae2291b00d7632aaf87ebcc4c 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -797,7 +797,7 @@ static inline void account_freepages(struct zone *zone, int nr_pages,
if (is_migrate_cma(migratetype))
__mod_zone_page_state(zone, NR_FREE_CMA_PAGES, nr_pages);
- else if (is_migrate_highatomic(migratetype))
+ else if (migratetype == MIGRATE_HIGHATOMIC)
WRITE_ONCE(zone->nr_free_highatomic,
zone->nr_free_highatomic + nr_pages);
}
---
base-commit: 5654520c361a6638f9d9e889257dfce38c83f653
change-id: 20250821-is-migrate-highatomic-871c0ff05a84
Best regards,
--
Brendan Jackman <jackmanb@google.com>
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] mm: Remove is_migrate_highatomic()
2025-08-21 13:29 [PATCH] mm: Remove is_migrate_highatomic() Brendan Jackman
@ 2025-08-21 14:04 ` Zi Yan
2025-08-21 14:05 ` David Hildenbrand
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Zi Yan @ 2025-08-21 14:04 UTC (permalink / raw)
To: Brendan Jackman
Cc: Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
Suren Baghdasaryan, Michal Hocko, Johannes Weiner, linux-mm,
linux-kernel
On 21 Aug 2025, at 9:29, Brendan Jackman wrote:
> There are 3 potential reasons for is_migrate_*() helpers:
>
> 1. They represent higher-level attributes of migratetypes, like
> is_migrate_movable()
>
> 2. They are ifdef'd, like is_migrate_isolate().
>
> 3. For consistency with an is_migrate_*_page() helper, also like
> is_migrate_isolate().
>
> It looks like is_migrate_highatomic() was for case 3, but that was
> removed in commit e0932b6c1f94 ("mm: page_alloc: consolidate free page
> accounting").
>
> So remove the indirection and go back to a simple comparison.
>
> Signed-off-by: Brendan Jackman <jackmanb@google.com>
> ---
> mm/internal.h | 5 -----
> mm/page_alloc.c | 2 +-
> 2 files changed, 1 insertion(+), 6 deletions(-)
>
LGTM. Reviewed-by: Zi Yan <ziy@nvidia.com>
--
Best Regards,
Yan, Zi
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mm: Remove is_migrate_highatomic()
2025-08-21 13:29 [PATCH] mm: Remove is_migrate_highatomic() Brendan Jackman
2025-08-21 14:04 ` Zi Yan
@ 2025-08-21 14:05 ` David Hildenbrand
2025-08-21 16:32 ` Johannes Weiner
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: David Hildenbrand @ 2025-08-21 14:05 UTC (permalink / raw)
To: Brendan Jackman, Andrew Morton, Lorenzo Stoakes, Liam R. Howlett,
Vlastimil Babka, Mike Rapoport, Suren Baghdasaryan, Michal Hocko,
Johannes Weiner, Zi Yan
Cc: linux-mm, linux-kernel
On 21.08.25 15:29, Brendan Jackman wrote:
> There are 3 potential reasons for is_migrate_*() helpers:
>
> 1. They represent higher-level attributes of migratetypes, like
> is_migrate_movable()
>
> 2. They are ifdef'd, like is_migrate_isolate().
>
> 3. For consistency with an is_migrate_*_page() helper, also like
> is_migrate_isolate().
>
> It looks like is_migrate_highatomic() was for case 3, but that was
> removed in commit e0932b6c1f94 ("mm: page_alloc: consolidate free page
> accounting").
>
> So remove the indirection and go back to a simple comparison.
>
> Signed-off-by: Brendan Jackman <jackmanb@google.com>
> ---
Acked-by: David Hildenbrand <david@redhat.com>
--
Cheers
David / dhildenb
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mm: Remove is_migrate_highatomic()
2025-08-21 13:29 [PATCH] mm: Remove is_migrate_highatomic() Brendan Jackman
2025-08-21 14:04 ` Zi Yan
2025-08-21 14:05 ` David Hildenbrand
@ 2025-08-21 16:32 ` Johannes Weiner
2025-08-21 16:38 ` Lorenzo Stoakes
2025-08-22 18:09 ` SeongJae Park
4 siblings, 0 replies; 6+ messages in thread
From: Johannes Weiner @ 2025-08-21 16:32 UTC (permalink / raw)
To: Brendan Jackman
Cc: Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
Suren Baghdasaryan, Michal Hocko, Zi Yan, linux-mm, linux-kernel
On Thu, Aug 21, 2025 at 01:29:47PM +0000, Brendan Jackman wrote:
> There are 3 potential reasons for is_migrate_*() helpers:
>
> 1. They represent higher-level attributes of migratetypes, like
> is_migrate_movable()
>
> 2. They are ifdef'd, like is_migrate_isolate().
>
> 3. For consistency with an is_migrate_*_page() helper, also like
> is_migrate_isolate().
>
> It looks like is_migrate_highatomic() was for case 3, but that was
> removed in commit e0932b6c1f94 ("mm: page_alloc: consolidate free page
> accounting").
>
> So remove the indirection and go back to a simple comparison.
>
> Signed-off-by: Brendan Jackman <jackmanb@google.com>
Oops! Thanks.
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mm: Remove is_migrate_highatomic()
2025-08-21 13:29 [PATCH] mm: Remove is_migrate_highatomic() Brendan Jackman
` (2 preceding siblings ...)
2025-08-21 16:32 ` Johannes Weiner
@ 2025-08-21 16:38 ` Lorenzo Stoakes
2025-08-22 18:09 ` SeongJae Park
4 siblings, 0 replies; 6+ messages in thread
From: Lorenzo Stoakes @ 2025-08-21 16:38 UTC (permalink / raw)
To: Brendan Jackman
Cc: Andrew Morton, David Hildenbrand, Liam R. Howlett,
Vlastimil Babka, Mike Rapoport, Suren Baghdasaryan, Michal Hocko,
Johannes Weiner, Zi Yan, linux-mm, linux-kernel
On Thu, Aug 21, 2025 at 01:29:47PM +0000, Brendan Jackman wrote:
> There are 3 potential reasons for is_migrate_*() helpers:
>
> 1. They represent higher-level attributes of migratetypes, like
> is_migrate_movable()
>
> 2. They are ifdef'd, like is_migrate_isolate().
>
> 3. For consistency with an is_migrate_*_page() helper, also like
> is_migrate_isolate().
>
> It looks like is_migrate_highatomic() was for case 3, but that was
> removed in commit e0932b6c1f94 ("mm: page_alloc: consolidate free page
> accounting").
>
> So remove the indirection and go back to a simple comparison.
>
> Signed-off-by: Brendan Jackman <jackmanb@google.com>
LGTM, so:
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> ---
> mm/internal.h | 5 -----
> mm/page_alloc.c | 2 +-
> 2 files changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/mm/internal.h b/mm/internal.h
> index 45b725c3dc030cb22a3cb0ddb262b6300e65ed5a..45da9ff5694f628db18f740718f0a7a06c4548f0 100644
> --- a/mm/internal.h
> +++ b/mm/internal.h
> @@ -1333,11 +1333,6 @@ extern const struct trace_print_flags pageflag_names[];
> extern const struct trace_print_flags vmaflag_names[];
> extern const struct trace_print_flags gfpflag_names[];
>
> -static inline bool is_migrate_highatomic(enum migratetype migratetype)
> -{
> - return migratetype == MIGRATE_HIGHATOMIC;
> -}
> -
> void setup_zone_pageset(struct zone *zone);
>
> struct migration_target_control {
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index ca9e6b9633f79ff28448a6008749fa6ca2696332..baead29b3e67bb3ae2291b00d7632aaf87ebcc4c 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -797,7 +797,7 @@ static inline void account_freepages(struct zone *zone, int nr_pages,
>
> if (is_migrate_cma(migratetype))
> __mod_zone_page_state(zone, NR_FREE_CMA_PAGES, nr_pages);
> - else if (is_migrate_highatomic(migratetype))
> + else if (migratetype == MIGRATE_HIGHATOMIC)
> WRITE_ONCE(zone->nr_free_highatomic,
> zone->nr_free_highatomic + nr_pages);
> }
>
> ---
> base-commit: 5654520c361a6638f9d9e889257dfce38c83f653
> change-id: 20250821-is-migrate-highatomic-871c0ff05a84
>
> Best regards,
> --
> Brendan Jackman <jackmanb@google.com>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mm: Remove is_migrate_highatomic()
2025-08-21 13:29 [PATCH] mm: Remove is_migrate_highatomic() Brendan Jackman
` (3 preceding siblings ...)
2025-08-21 16:38 ` Lorenzo Stoakes
@ 2025-08-22 18:09 ` SeongJae Park
4 siblings, 0 replies; 6+ messages in thread
From: SeongJae Park @ 2025-08-22 18:09 UTC (permalink / raw)
To: Brendan Jackman
Cc: SeongJae Park, Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
Suren Baghdasaryan, Michal Hocko, Johannes Weiner, Zi Yan,
linux-mm, linux-kernel
On Thu, 21 Aug 2025 13:29:47 +0000 Brendan Jackman <jackmanb@google.com> wrote:
> There are 3 potential reasons for is_migrate_*() helpers:
>
> 1. They represent higher-level attributes of migratetypes, like
> is_migrate_movable()
>
> 2. They are ifdef'd, like is_migrate_isolate().
>
> 3. For consistency with an is_migrate_*_page() helper, also like
> is_migrate_isolate().
>
> It looks like is_migrate_highatomic() was for case 3, but that was
> removed in commit e0932b6c1f94 ("mm: page_alloc: consolidate free page
> accounting").
>
> So remove the indirection and go back to a simple comparison.
>
> Signed-off-by: Brendan Jackman <jackmanb@google.com>
Acked-by: SeongJae Park <sj@kernel.org>
Thanks,
SJ
[...]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-08-22 18:09 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-21 13:29 [PATCH] mm: Remove is_migrate_highatomic() Brendan Jackman
2025-08-21 14:04 ` Zi Yan
2025-08-21 14:05 ` David Hildenbrand
2025-08-21 16:32 ` Johannes Weiner
2025-08-21 16:38 ` Lorenzo Stoakes
2025-08-22 18:09 ` SeongJae Park
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).