Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] memblock: simplify reset_all_zones_managed_pages()
@ 2026-08-19 15:44 Sang-Heon Jeon
  2026-08-23 14:48 ` Mike Rapoport
  0 siblings, 1 reply; 2+ messages in thread
From: Sang-Heon Jeon @ 2026-08-19 15:44 UTC (permalink / raw)
  To: Andrew Morton, Mike Rapoport; +Cc: linux-mm

reset_all_zones_managed_pages() is only called from memblock_free_all(),
which runs once during boot.

So remove the reset_managed_pages_done guard, make the function static
and drop its declaration.

No functional change.

Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
---
 include/linux/memblock.h | 1 -
 mm/memblock.c            | 9 +--------
 2 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index 5afcd99aa8c1..83dc821b23ad 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -160,7 +160,6 @@ int memblock_mark_kho_scratch(phys_addr_t base, phys_addr_t size);
 int memblock_clear_kho_scratch(phys_addr_t base, phys_addr_t size);
 
 void memblock_free(void *ptr, size_t size);
-void reset_all_zones_managed_pages(void);
 
 /* Low level functions */
 void __next_mem_range(u64 *idx, int nid, enum memblock_flags flags,
diff --git a/mm/memblock.c b/mm/memblock.c
index 43e036f3e11a..5954d005dbb1 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -2368,8 +2368,6 @@ static unsigned long __init free_low_memory_core_early(void)
 	return count;
 }
 
-static int reset_managed_pages_done __initdata;
-
 static void __init reset_node_managed_pages(pg_data_t *pgdat)
 {
 	struct zone *z;
@@ -2378,17 +2376,12 @@ static void __init reset_node_managed_pages(pg_data_t *pgdat)
 		atomic_long_set(&z->managed_pages, 0);
 }
 
-void __init reset_all_zones_managed_pages(void)
+static void __init reset_all_zones_managed_pages(void)
 {
 	struct pglist_data *pgdat;
 
-	if (reset_managed_pages_done)
-		return;
-
 	for_each_online_pgdat(pgdat)
 		reset_node_managed_pages(pgdat);
-
-	reset_managed_pages_done = 1;
 }
 
 /**
-- 
2.43.0



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

* Re: [PATCH] memblock: simplify reset_all_zones_managed_pages()
  2026-08-19 15:44 [PATCH] memblock: simplify reset_all_zones_managed_pages() Sang-Heon Jeon
@ 2026-08-23 14:48 ` Mike Rapoport
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Rapoport @ 2026-08-23 14:48 UTC (permalink / raw)
  To: Andrew Morton, Sang-Heon Jeon; +Cc: linux-mm

On Thu, 20 Aug 2026 00:44:34 +0900, Sang-Heon Jeon wrote:
> memblock: simplify reset_all_zones_managed_pages()

Applied to queue branch of memblock.git tree, thanks!

[1/1] memblock: simplify reset_all_zones_managed_pages()
      commit: ec03938cbaf99c44f97ffc106dd8ac3ccacfeece

tree: https://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock
branch: queue

--
Sincerely yours,
Mike.




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

end of thread, other threads:[~2026-08-23 14:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-19 15:44 [PATCH] memblock: simplify reset_all_zones_managed_pages() Sang-Heon Jeon
2026-08-23 14:48 ` Mike Rapoport

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