From: Mike Rapoport <rppt@kernel.org>
To: openrisc@lists.librecores.org
Subject: [OpenRISC] [PATCH v2 19/20] mm: simplify find_min_pfn_with_active_regions()
Date: Wed, 29 Apr 2020 15:11:25 +0300 [thread overview]
Message-ID: <20200429121126.17989-20-rppt@kernel.org> (raw)
In-Reply-To: <20200429121126.17989-1-rppt@kernel.org>
From: Mike Rapoport <rppt@linux.ibm.com>
The find_min_pfn_with_active_regions() calls find_min_pfn_for_node() with
nid parameter set to MAX_NUMNODES. This makes the find_min_pfn_for_node()
traverse all memblock memory regions although the first PFN in the system
can be easily found with memblock_start_of_DRAM().
Use memblock_start_of_DRAM() in find_min_pfn_with_active_regions() and drop
now unused find_min_pfn_for_node().
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
---
mm/page_alloc.c | 20 +-------------------
1 file changed, 1 insertion(+), 19 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 30d171451d4c..b990e9734474 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -7045,24 +7045,6 @@ unsigned long __init node_map_pfn_alignment(void)
return ~accl_mask + 1;
}
-/* Find the lowest pfn for a node */
-static unsigned long __init find_min_pfn_for_node(int nid)
-{
- unsigned long min_pfn = ULONG_MAX;
- unsigned long start_pfn;
- int i;
-
- for_each_mem_pfn_range(i, nid, &start_pfn, NULL, NULL)
- min_pfn = min(min_pfn, start_pfn);
-
- if (min_pfn == ULONG_MAX) {
- pr_warn("Could not find start_pfn for node %d\n", nid);
- return 0;
- }
-
- return min_pfn;
-}
-
/**
* find_min_pfn_with_active_regions - Find the minimum PFN registered
*
@@ -7071,7 +7053,7 @@ static unsigned long __init find_min_pfn_for_node(int nid)
*/
unsigned long __init find_min_pfn_with_active_regions(void)
{
- return find_min_pfn_for_node(MAX_NUMNODES);
+ return PHYS_PFN(memblock_start_of_DRAM());
}
/*
--
2.26.1
next prev parent reply other threads:[~2020-04-29 12:11 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-29 12:11 [OpenRISC] [PATCH v2 00/20] mm: rework free_area_init*() funcitons Mike Rapoport
2020-04-29 12:11 ` [OpenRISC] [PATCH v2 01/20] mm: memblock: replace dereferences of memblock_region.nid with API calls Mike Rapoport
2020-04-29 12:11 ` [OpenRISC] [PATCH v2 02/20] mm: make early_pfn_to_nid() and related defintions close to each other Mike Rapoport
2020-04-29 12:11 ` [OpenRISC] [PATCH v2 03/20] mm: remove CONFIG_HAVE_MEMBLOCK_NODE_MAP option Mike Rapoport
2020-05-26 17:11 ` Catalin Marinas
2020-04-29 12:11 ` [OpenRISC] [PATCH v2 04/20] mm: free_area_init: use maximal zone PFNs rather than zone sizes Mike Rapoport
2020-04-29 12:11 ` [OpenRISC] [PATCH v2 05/20] mm: use free_area_init() instead of free_area_init_nodes() Mike Rapoport
2020-05-26 17:13 ` Catalin Marinas
2020-04-29 12:11 ` [OpenRISC] [PATCH v2 06/20] alpha: simplify detection of memory zone boundaries Mike Rapoport
2020-04-29 12:11 ` [OpenRISC] [PATCH v2 07/20] arm: " Mike Rapoport
2020-04-29 12:11 ` [OpenRISC] [PATCH v2 08/20] arm64: simplify detection of memory zone boundaries for UMA configs Mike Rapoport
2020-05-26 17:15 ` Catalin Marinas
2020-04-29 12:11 ` [OpenRISC] [PATCH v2 09/20] csky: simplify detection of memory zone boundaries Mike Rapoport
2020-04-29 12:11 ` [OpenRISC] [PATCH v2 10/20] m68k: mm: " Mike Rapoport
2020-04-29 12:11 ` [OpenRISC] [PATCH v2 11/20] parisc: " Mike Rapoport
2020-04-29 12:11 ` [OpenRISC] [PATCH v2 12/20] sparc32: " Mike Rapoport
2020-04-29 12:11 ` [OpenRISC] [PATCH v2 13/20] unicore32: " Mike Rapoport
2020-04-29 12:11 ` [OpenRISC] [PATCH v2 14/20] xtensa: " Mike Rapoport
2020-04-29 12:11 ` [OpenRISC] [PATCH v2 15/20] mm: memmap_init: iterate over memblock regions rather that check each PFN Mike Rapoport
2020-04-29 12:11 ` [OpenRISC] [PATCH v2 16/20] mm: remove early_pfn_in_nid() and CONFIG_NODES_SPAN_OTHER_NODES Mike Rapoport
2020-04-29 14:17 ` Christoph Hellwig
2020-04-29 14:33 ` Mike Rapoport
2020-04-29 16:29 ` [OpenRISC] [PATCH v2.5 " Mike Rapoport
2020-04-29 12:11 ` [OpenRISC] [PATCH v2 17/20] mm: free_area_init: allow defining max_zone_pfn in descending order Mike Rapoport
2020-05-03 17:41 ` Guenter Roeck
2020-05-03 18:43 ` Guenter Roeck
2020-05-04 15:39 ` Mike Rapoport
2020-05-05 13:18 ` Guenter Roeck
2020-05-05 13:45 ` Mike Rapoport
2020-05-05 17:27 ` Vineet Gupta
2020-04-29 12:11 ` [OpenRISC] [PATCH v2 18/20] mm: clean up free_area_init_node() and its helpers Mike Rapoport
2020-04-29 12:11 ` Mike Rapoport [this message]
2020-04-29 12:11 ` [OpenRISC] [PATCH v2 20/20] docs/vm: update memory-models documentation 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=20200429121126.17989-20-rppt@kernel.org \
--to=rppt@kernel.org \
--cc=openrisc@lists.librecores.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