hotplug memory range is memory_block aligned and walk_memroy_range guarded
with check_hotplug_memory_range(). This is save to iterate on the
memory_block base.
This patch adjust the iteration unit and assume there is not hole in
hotplug memory range.
Signed-off-by: Wei Yang <redacted>
---
mm/memory_hotplug.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index f5d06afc8645..a79a83ec965f 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1858,17 +1858,11 @@ int walk_memory_range(unsigned long start_pfn, unsigned long end_pfn,
unsigned long pfn, section_nr;
int ret;
- for (pfn = start_pfn; pfn < end_pfn; pfn += PAGES_PER_SECTION) {
+ for (pfn = start_pfn; pfn < end_pfn;
+ pfn += PAGES_PER_SECTION * sections_per_block) {
section_nr = pfn_to_section_nr(pfn);
- if (!present_section_nr(section_nr))
- continue;
section = __nr_to_section(section_nr);
- /* same memblock? */
- if (mem)
- if ((section_nr >= mem->start_section_nr) &&
- (section_nr <= mem->end_section_nr))
- continue;
mem = find_memory_block_hinted(section, mem);
if (!mem)--
2.11.0
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>