All of lore.kernel.org
 help / color / mirror / Atom feed
* [to-be-updated] mm-page_alloc-do-not-calculate-nodes-total-pages-and-memmap-pages-when-empty.patch removed from -mm tree
@ 2022-04-28 21:51 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2022-04-28 21:51 UTC (permalink / raw)
  To: mm-commits, richard.weiyang, mhocko, linmiaohe, david, osalvador, akpm


The patch titled
     Subject: mm/page_alloc: do not calculate node's total pages and memmap pages when empty
has been removed from the -mm tree.  Its filename was
     mm-page_alloc-do-not-calculate-nodes-total-pages-and-memmap-pages-when-empty.patch

This patch was dropped because an updated version will be merged

------------------------------------------------------
From: Oscar Salvador <osalvador@suse.de>
Subject: mm/page_alloc: do not calculate node's total pages and memmap pages when empty

Patch series "A minor hotplug refactoring".


This patch (of 3):

free_area_init_node() calls calculate_node_totalpages() and
free_area_init_core().  The former to get node's {spanned,present}_pages,
and the latter to calculate, among other things, how many pages per zone
we spent on memmap_pages, which is used to subtract zone's free pages.

On memoryless nodes, it is pointless to perform such a bunch of work, so
make sure we skip the calculations when having a node or empty zone.

Link: https://lkml.kernel.org/r/20220307150725.6810-1-osalvador@suse.de
Link: https://lkml.kernel.org/r/20220307150725.6810-2-osalvador@suse.de
Signed-off-by: Oscar Salvador <osalvador@suse.de>
Cc: David Hildenbrand <david@redhat.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Wei Yang <richard.weiyang@gmail.com>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/page_alloc.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

--- a/mm/page_alloc.c~mm-page_alloc-do-not-calculate-nodes-total-pages-and-memmap-pages-when-empty
+++ a/mm/page_alloc.c
@@ -7291,6 +7291,10 @@ static void __init calculate_node_totalp
 	unsigned long realtotalpages = 0, totalpages = 0;
 	enum zone_type i;
 
+	/* Skip calculation for memoryless nodes */
+	if (node_start_pfn == node_end_pfn)
+		goto no_pages;
+
 	for (i = 0; i < MAX_NR_ZONES; i++) {
 		struct zone *zone = pgdat->node_zones + i;
 		unsigned long zone_start_pfn, zone_end_pfn;
@@ -7323,6 +7327,7 @@ static void __init calculate_node_totalp
 		realtotalpages += real_size;
 	}
 
+no_pages:
 	pgdat->node_spanned_pages = totalpages;
 	pgdat->node_present_pages = realtotalpages;
 	pr_debug("On node %d totalpages: %lu\n", pgdat->node_id, realtotalpages);
@@ -7540,6 +7545,10 @@ static void __init free_area_init_core(s
 		size = zone->spanned_pages;
 		freesize = zone->present_pages;
 
+		/* No pages? Nothing to calculate then. */
+		if (!size)
+			goto no_pages;
+
 		/*
 		 * Adjust freesize so that it accounts for how much memory
 		 * is used by this zone for memmap. This affects the watermark
@@ -7575,6 +7584,7 @@ static void __init free_area_init_core(s
 		 * when the bootmem allocator frees pages into the buddy system.
 		 * And all highmem pages will be managed by the buddy system.
 		 */
+no_pages:
 		zone_init_internals(zone, j, nid, freesize);
 
 		if (!size)
_

Patches currently in -mm which might be from osalvador@suse.de are

mm-memory_hotplug-reset-nodes-state-when-empty-during-offline.patch
mm-memory_hotplug-refactor-hotadd_init_pgdat-and-try_online_node.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-28 21:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-28 21:51 [to-be-updated] mm-page_alloc-do-not-calculate-nodes-total-pages-and-memmap-pages-when-empty.patch removed from -mm tree Andrew Morton

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.