mm: Drain pages after onlining
When onlining, the onlined pages must be added to the kernel's list of free pages using __free_page(). However, pages are not immediately added but placed in a queue to be processed when the queue size reaches a watermark. The last pages in the queue may not be processed in time, and if you try to offline that memory before it is processed, offlining will always fail. This fix calls drain_all_pages(), which will process every free page in the queue. This ensures that all pages are accounted for when onlining and nothing gets stuck in the queue. Change-Id: I54dbc0749556702407090e51ce9246abc5db7d1c Signed-off-by: Jack Cheung <jackc@codeaurora.org>
This commit is contained in:
@@ -466,6 +466,7 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages)
|
||||
|
||||
zone->present_pages += onlined_pages;
|
||||
zone->zone_pgdat->node_present_pages += onlined_pages;
|
||||
drain_all_pages();
|
||||
if (need_zonelists_rebuild)
|
||||
build_all_zonelists(zone);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user