[Part3 PATCH v2 4/4] mem-hotplug: Do not free LOCAL_NODE_DATA pages to buddy system in hot-remove procedure.

From: Tang Chen
Date: Thu Jun 13 2013 - 09:41:51 EST


In memory hot-remove procedure, we free pagetable pages to buddy system.
But for local pagetable pages, do not free them to buddy system because
they were skipped in offline procedure. The memory block they reside in
could have been offlined, and we won't offline it again.

v1 -> v2: Prevent freeing LOCAL_NODE_DATA pages in free_pagetable() instead
of in put_page_bootmem().

Suggested-by: Wu Jianguo <wujianguo@xxxxxxxxxx>
Signed-off-by: Tang Chen <tangchen@xxxxxxxxxxxxxx>
---
arch/x86/mm/init_64.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 25de304..ffaf24a 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -726,7 +726,13 @@ static void __meminit free_pagetable(struct page *page, int order)
if (magic == SECTION_INFO || magic == MIX_SECTION_INFO) {
while (nr_pages--)
put_page_bootmem(page++);
- } else
+ } else if (!is_local_node_data(page))
+ /*
+ * Do not free pages with local node kernel data
+ * (for now, just local pagetables) to the buddy
+ * system because we skipped these pages when
+ * offlining the corresponding block.
+ */
__free_pages_bootmem(page, order);
} else
free_pages((unsigned long)page_address(page), order);
--
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/