diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-07-20 09:39:11 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-07-20 09:39:11 +0200 |
| commit | 6f2c6599ba70da7ca9603f8026c4e3cdc273ee02 (patch) | |
| tree | 88228298182133d9522be62c8cb3eecfcb595d49 /mm/memory_hotplug.c | |
| parent | ea1be1e59b19017e61aa357d524b743ba5602d3c (diff) | |
| parent | ba47d845d715a010f7b51f6f89bae32845e6acb7 (diff) | |
| download | cachepc-linux-6f2c6599ba70da7ca9603f8026c4e3cdc273ee02.tar.gz cachepc-linux-6f2c6599ba70da7ca9603f8026c4e3cdc273ee02.zip | |
Merge 5.8-rc6 into tty-next
We need the serial/tty fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm/memory_hotplug.c')
| -rw-r--r-- | mm/memory_hotplug.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 9b34e03e730a..da374cd3d45b 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -471,11 +471,20 @@ void __ref remove_pfn_range_from_zone(struct zone *zone, unsigned long start_pfn, unsigned long nr_pages) { + const unsigned long end_pfn = start_pfn + nr_pages; struct pglist_data *pgdat = zone->zone_pgdat; - unsigned long flags; + unsigned long pfn, cur_nr_pages, flags; /* Poison struct pages because they are now uninitialized again. */ - page_init_poison(pfn_to_page(start_pfn), sizeof(struct page) * nr_pages); + for (pfn = start_pfn; pfn < end_pfn; pfn += cur_nr_pages) { + cond_resched(); + + /* Select all remaining pages up to the next section boundary */ + cur_nr_pages = + min(end_pfn - pfn, SECTION_ALIGN_UP(pfn + 1) - pfn); + page_init_poison(pfn_to_page(pfn), + sizeof(struct page) * cur_nr_pages); + } #ifdef CONFIG_ZONE_DEVICE /* |
