* [PATCHv1] mm: always initialize pages as reserved to fix memory hotplug
@ 2015-07-30 14:04 David Vrabel
2015-07-30 14:45 ` Mel Gorman
0 siblings, 1 reply; 3+ messages in thread
From: David Vrabel @ 2015-07-30 14:04 UTC (permalink / raw)
To: linux-kernel
Cc: David Vrabel, linux-mm, Robin Holt, Nathan Zimmer, Mel Gorman
Commit 92923ca3aacef63c92dc297a75ad0c6dfe4eab37 (mm: meminit: only set
page reserved in the memblock region) breaks memory hotplug because pages
within newly added sections are not marked as reserved as required by
the memory hotplug driver. If pages within an offline section are not
reserved, the secton cannot be onlined.
Re-add the SetPageReserved() call.
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Cc: Robin Holt <holt@sgi.com>
Cc: Nathan Zimmer <nzimmer@sgi.com>
Cc: Mel Gorman <mgorman@suse.de>
---
mm/page_alloc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index ef19f22..89492f6 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -842,6 +842,7 @@ static void __meminit __init_single_page(struct page *page, unsigned long pfn,
init_page_count(page);
page_mapcount_reset(page);
page_cpupid_reset_last(page);
+ SetPageReserved(page);
INIT_LIST_HEAD(&page->lru);
#ifdef WANT_PAGE_VIRTUAL
--
2.1.4
--
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>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCHv1] mm: always initialize pages as reserved to fix memory hotplug
2015-07-30 14:04 [PATCHv1] mm: always initialize pages as reserved to fix memory hotplug David Vrabel
@ 2015-07-30 14:45 ` Mel Gorman
2015-07-30 16:41 ` David Vrabel
0 siblings, 1 reply; 3+ messages in thread
From: Mel Gorman @ 2015-07-30 14:45 UTC (permalink / raw)
To: David Vrabel; +Cc: linux-kernel, linux-mm, Robin Holt, Nathan Zimmer
On Thu, Jul 30, 2015 at 03:04:43PM +0100, David Vrabel wrote:
> Commit 92923ca3aacef63c92dc297a75ad0c6dfe4eab37 (mm: meminit: only set
> page reserved in the memblock region) breaks memory hotplug because pages
> within newly added sections are not marked as reserved as required by
> the memory hotplug driver.
I don't have access to a large machine at the moment to verify and won't
have until Monday at the earliest but I think that will bust deferred
initialisation.
Why not either SetPageReserved from mem hotplug driver? It might be neater
to remove the PageReserved check from online_pages_range() but then care
would have to be taken to ensure that invalid PFNs within section that
have no memory backing them were properly reserved. This is an untested,
uncompiled version of the first suggestion
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 26fbba7d888f..003dbe4b060d 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -446,7 +446,7 @@ static int __meminit __add_zone(struct zone *zone, unsigned long phys_start_pfn)
int nr_pages = PAGES_PER_SECTION;
int nid = pgdat->node_id;
int zone_type;
- unsigned long flags;
+ unsigned long flags, pfn;
int ret;
zone_type = zone - pgdat->node_zones;
@@ -461,6 +461,14 @@ static int __meminit __add_zone(struct zone *zone, unsigned long phys_start_pfn)
pgdat_resize_unlock(zone->zone_pgdat, &flags);
memmap_init_zone(nr_pages, nid, zone_type,
phys_start_pfn, MEMMAP_HOTPLUG);
+
+ /* online_page_range is called later and expects pages reserved */
+ for (pfn = phys_start_pfn; pfn < phys_start_pfn + nr_pages; pfn++) {
+ if (!pfn_valid(pfn))
+ continue;
+
+ SetPageReserved(pfn_to_page(pfn));
+ }
return 0;
}
--
Mel Gorman
SUSE Labs
--
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>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCHv1] mm: always initialize pages as reserved to fix memory hotplug
2015-07-30 14:45 ` Mel Gorman
@ 2015-07-30 16:41 ` David Vrabel
0 siblings, 0 replies; 3+ messages in thread
From: David Vrabel @ 2015-07-30 16:41 UTC (permalink / raw)
To: Mel Gorman; +Cc: linux-kernel, linux-mm, Robin Holt, Nathan Zimmer
On 30/07/15 15:45, Mel Gorman wrote:
> On Thu, Jul 30, 2015 at 03:04:43PM +0100, David Vrabel wrote:
>> Commit 92923ca3aacef63c92dc297a75ad0c6dfe4eab37 (mm: meminit: only set
>> page reserved in the memblock region) breaks memory hotplug because pages
>> within newly added sections are not marked as reserved as required by
>> the memory hotplug driver.
>
> I don't have access to a large machine at the moment to verify and won't
> have until Monday at the earliest but I think that will bust deferred
> initialisation.
>
> Why not either SetPageReserved from mem hotplug driver? It might be neater
> to remove the PageReserved check from online_pages_range() but then care
> would have to be taken to ensure that invalid PFNs within section that
> have no memory backing them were properly reserved. This is an untested,
> uncompiled version of the first suggestion
Thanks.
Tested-by: David Vrabel <david.vrabel@citrix.com>
8<------------------------------
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-07-30 16:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-30 14:04 [PATCHv1] mm: always initialize pages as reserved to fix memory hotplug David Vrabel
2015-07-30 14:45 ` Mel Gorman
2015-07-30 16:41 ` David Vrabel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).