All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-page_alloc-do-not-calculate-nodes-total-pages-and-memmap-pages-when-empty.patch added to -mm tree
@ 2022-03-29  1:18 Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2022-03-29  1:18 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 added to the -mm tree.  Its filename is
     mm-page_alloc-do-not-calculate-nodes-total-pages-and-memmap-pages-when-empty.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/mm-page_alloc-do-not-calculate-nodes-total-pages-and-memmap-pages-when-empty.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/mm-page_alloc-do-not-calculate-nodes-total-pages-and-memmap-pages-when-empty.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
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 substract 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
@@ -7321,6 +7321,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;
@@ -7353,6 +7357,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);
@@ -7570,6 +7575,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
@@ -7605,6 +7614,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-untangle-config-dependencies-for-demote-on-reclaim.patch
mm-page_alloc-do-not-calculate-nodes-total-pages-and-memmap-pages-when-empty.patch
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] 2+ messages in thread

* + mm-page_alloc-do-not-calculate-nodes-total-pages-and-memmap-pages-when-empty.patch added to -mm tree
@ 2022-03-29  1:20 Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2022-03-29  1:20 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 added to the -mm tree.  Its filename is
     mm-page_alloc-do-not-calculate-nodes-total-pages-and-memmap-pages-when-empty.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/mm-page_alloc-do-not-calculate-nodes-total-pages-and-memmap-pages-when-empty.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/mm-page_alloc-do-not-calculate-nodes-total-pages-and-memmap-pages-when-empty.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
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
@@ -7321,6 +7321,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;
@@ -7353,6 +7357,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);
@@ -7570,6 +7575,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
@@ -7605,6 +7614,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-untangle-config-dependencies-for-demote-on-reclaim.patch
mm-page_alloc-do-not-calculate-nodes-total-pages-and-memmap-pages-when-empty.patch
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] 2+ messages in thread

end of thread, other threads:[~2022-03-29  1:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-29  1:20 + mm-page_alloc-do-not-calculate-nodes-total-pages-and-memmap-pages-when-empty.patch added to -mm tree Andrew Morton
  -- strict thread matches above, loose matches on Subject: below --
2022-03-29  1:18 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.