mm-memory-hotplug-enable-memory-hotplug-to-handle-hugepage.patch removed from -mm tree
Subsystems (4)
[email protected]
maintainerSubject: [merged] mm-memory-hotplug-enable-memory-hotplug-to-handle-hugepage.patch removed from -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Thu, 12 Sep 2013 12:44:23 -0700
The patch titled
Subject: mm: memory-hotplug: enable memory hotplug to handle hugepage
has been removed from the -mm tree. Its filename was
mm-memory-hotplug-enable-memory-hotplug-to-handle-hugepage.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Naoya Horiguchi <[email protected]>
Subject: mm: memory-hotplug: enable memory hotplug to handle hugepage
Until now we can't offline memory blocks which contain hugepages because a hugepage is considered as an unmovable page. But now with this patch series, a hugepage has become movable, so by using hugepage migration we can offline such memory blocks.
What's different from other users of hugepage migration is that we need to decompose all the hugepages inside the target memory block into free buddy pages after hugepage migration, because otherwise free hugepages remaining in the memory block intervene the memory offlining. For this reason we introduce new functions dissolve_free_huge_page() and dissolve_free_huge_pages().
Other than that, what this patch does is straightforwardly to add hugepage migration code, that is, adding hugepage code to the functions which scan over pfn and collect hugepages to be migrated, and adding a hugepage allocation function to alloc_migrate_target().
As for larger hugepages (1GB for x86_64), it's not easy to do hotremove over them because it's larger than memory block. So we now simply leave it to fail as it is.
---
include/linux/hugetlb.h | 6 +++ mm/hugetlb.c | 71 ++++++++++++++++++++++++++++++++++++-- mm/memory_hotplug.c | 42 ++++++++++++++++++---- mm/page_alloc.c | 11 +++++ mm/page_isolation.c | 14 +++++++ 5 files changed, 135 insertions(+), 9 deletions(-)
include/linux/hugetlb.h renamed from include/linux/hugetlb.h~mm-memory-hotplug-enable-memory-hotplug-to-handle-hugepage +6 -0
@@ -68,6 +68,7 @@ void hugetlb_unreserve_pages(struct inodint dequeue_hwpoisoned_huge_page (struct page *page);bool isolate_huge_page (struct page *page,struct list_head *list);void putback_active_hugepage (struct page *page); +bool is_hugepage_active (struct page *page);void copy_huge_page (struct page *dst,struct page *src);#ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE
@@ -138,6 +139,7 @@ static inline int dequeue_hwpoisoned_hug#define isolate_huge_page (p, l) false#define putback_active_hugepage (p) do {} while (0) +#define is_hugepage_active (x) falsestatic inline void copy_huge_page (struct page *dst,struct page *src) { }
@@ -377,6 +379,9 @@ static inline pgoff_t basepage_index(str return __basepage_index(page); } +extern void dissolve_free_huge_pages (unsigned long start_pfn, +unsigned long end_pfn); +#else /* CONFIG_HUGETLB_PAGE */ struct hstate {};#define alloc_huge_page_node (h, nid) NULL
@@ -403,6 +408,7 @@ static inline pgoff_t basepage_index(str {return page->index; } +#define dissolve_free_huge_pages (s, e) do {} while (0)#endif /* CONFIG_HUGETLB_PAGE */ #endif /* _LINUX_HUGETLB_H */
mm/hugetlb.c renamed from mm/hugetlb.c~mm-memory-hotplug-enable-memory-hotplug-to-handle-hugepage +69 -2
93 lines not on this page · raw message
mm/memory_hotplug.c renamed from mm/memory_hotplug.c~mm-memory-hotplug-enable-memory-hotplug-to-handle-hugepage +35 -7
91 lines not on this page · raw message
mm/page_alloc.c renamed from mm/page_alloc.c~mm-memory-hotplug-enable-memory-hotplug-to-handle-hugepage +11 -0
@@ -6008,6 +6008,17 @@ bool has_unmovable_pages(struct zone *zocontinue ; page =pfn_to_page (check); + +/* +* Hugepages are not in LRU lists, but they're movable. +* We need not scan over tail pages bacause we don't +* handle each tail page individually in migration. +*/ +if (PageHuge (page)) { + iter =round_up (iter +1 ,1 <<compound_order (page)) -1 ; +continue ; + } +/* * We can't use page_count without pin a page * because another CPU can free compound page.
mm/page_isolation.c renamed from mm/page_isolation.c~mm-memory-hotplug-enable-memory-hotplug-to-handle-hugepage +14 -0
@@ -6,6 +6,7 @@#include <linux/page-isolation.h> #include <linux/pageblock-flags.h> #include <linux/memory.h> +#include <linux/hugetlb.h> #include "internal.h" int set_migratetype_isolate (struct page *page,bool skip_hwpoisoned_pages)
@@ -252,6 +253,19 @@ struct page *alloc_migrate_target(struct {gfp_t gfp_mask =GFP_USER | __GFP_MOVABLE; +/* +* TODO: allocate a destination hugepage from a nearest neighbor node, +* accordance with memory policy of the user process if possible. For +* now as a simple work-around, we use the next node for destination. +*/ +if (PageHuge (page)) { +nodemask_t src =nodemask_of_node (page_to_nid (page)); +nodemask_t dst; +nodes_complement (dst, src); +return alloc_huge_page_node (page_hstate (compound_head (page)), +next_node (page_to_nid (page), dst)); + } +if (PageHighMem (page)) gfp_mask |= __GFP_HIGHMEM;
_
Patches currently in -mm which might be from [email protected] are
origin.patch