linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jiwen Qi <jiwen7.qi@gmail.com>
To: david@redhat.com
Cc: linux-mm@kvack.org, rppt@kernel.org
Subject: [PATCH v2] mm/mm_init: Fix the zone->managed_pages comment to match the code
Date: Sun, 12 Jan 2025 16:10:20 +0000	[thread overview]
Message-ID: <20250112161020.28021-1-jiwen7.qi@gmail.com> (raw)
In-Reply-To: <019308b6-8dbf-4f17-8979-714297f559d6@redhat.com>

The invocation of zone_init_internals(zone, j, nid, zone->present_pages)
initializes zone->managed_pages to zone->present_pages. zone->present_pages
is not 0 when the zone is not empty.

See commit 0ac5e785dcb797 ("mm/mm_init.c: remove meaningless calculation
of zone->managed_pages in free_area_init_core()") for details.

Signed-off-by: Jiwen Qi <jiwen7.qi@gmail.com>
---
 mm/mm_init.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mm/mm_init.c b/mm/mm_init.c
index 24b68b425afb..48a4f661db98 100644
--- a/mm/mm_init.c
+++ b/mm/mm_init.c
@@ -1567,8 +1567,9 @@ static void __init free_area_init_core(struct pglist_data *pgdat)
 		unsigned long size = zone->spanned_pages;
 
 		/*
-		 * Initialize zone->managed_pages as 0 , it will be reset
-		 * when memblock allocator frees pages into buddy system.
+		 * Initialize zone->managed_pages to zone->present_pages as a first rough
+		 * estimate. memblock_free_all() will reset zone->managed_pages to 0, and
+		 * calculate the actual managed pages as they are freed to the buddy.
 		 */
 		zone_init_internals(zone, j, nid, zone->present_pages);
 

base-commit: 4bbf9020becbfd8fc2c3da790855b7042fad455b
-- 
2.25.1



      reply	other threads:[~2025-01-12 16:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-29 18:09 [PATCH] " Jiwen Qi
2025-01-09 14:28 ` David Hildenbrand
2025-01-12 16:10   ` Jiwen Qi [this message]

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=20250112161020.28021-1-jiwen7.qi@gmail.com \
    --to=jiwen7.qi@gmail.com \
    --cc=david@redhat.com \
    --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