From: Sang-Heon Jeon <ekffu200098@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
Mike Rapoport <rppt@kernel.org>
Cc: linux-mm@kvack.org
Subject: [PATCH] memblock: simplify reset_all_zones_managed_pages()
Date: Thu, 20 Aug 2026 00:44:34 +0900 [thread overview]
Message-ID: <20260819154436.3225746-1-ekffu200098@gmail.com> (raw)
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
next reply other threads:[~2026-08-19 15:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-19 15:44 Sang-Heon Jeon [this message]
2026-08-23 14:48 ` [PATCH] memblock: simplify reset_all_zones_managed_pages() Mike Rapoport
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260819154436.3225746-1-ekffu200098@gmail.com \
--to=ekffu200098@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=rppt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.