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: use for_each_zone() in reset_all_zones_managed_pages()
Date: Wed, 9 Sep 2026 01:57:32 +0900 [thread overview]
Message-ID: <20260908165733.1703766-1-ekffu200098@gmail.com> (raw)
reset_all_zones_managed_pages() iterates over the zones of every
online node with a nested loop. for_each_zone() iterates over the same
zones in the same order.
So use for_each_zone() instead and remove reset_node_managed_pages().
No functional change.
Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
---
mm/memblock.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/mm/memblock.c b/mm/memblock.c
index 4302fb4ab85c..ed6937be8d9f 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -2465,22 +2465,14 @@ static unsigned long __init free_low_memory_core_early(void)
return count;
}
-static void __init reset_node_managed_pages(pg_data_t *pgdat)
+static void __init reset_all_zones_managed_pages(void)
{
struct zone *z;
- for (z = pgdat->node_zones; z < pgdat->node_zones + MAX_NR_ZONES; z++)
+ for_each_zone(z)
atomic_long_set(&z->managed_pages, 0);
}
-static void __init reset_all_zones_managed_pages(void)
-{
- struct pglist_data *pgdat;
-
- for_each_online_pgdat(pgdat)
- reset_node_managed_pages(pgdat);
-}
-
/**
* memblock_free_all - release free pages to the buddy allocator
*/
base-commit: dbffc67777cd752ef3f77818109e1d2ef13e2949
--
2.43.0
next reply other threads:[~2026-09-08 16:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-08 16:57 Sang-Heon Jeon [this message]
2026-09-10 9:58 ` [PATCH] memblock: use for_each_zone() in reset_all_zones_managed_pages() Mike Rapoport
2026-09-10 10:13 ` Mike Rapoport
2026-09-10 12:19 ` Sang-Heon Jeon
2026-09-10 14:35 ` Sang-Heon Jeon
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=20260908165733.1703766-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox