Patchwork mm/madvise: enable soft offline of HugeTLB pages at PUD level

login
register
mail settings
Submitter Alexandru Moise
Date Sept. 13, 2017, 10:10 a.m.
Message ID <20170913101047.GA13026@gmail.com>
Download mbox | patch
Permalink /patch/9950877/
State New
Headers show

Comments

Alexandru Moise - Sept. 13, 2017, 10:10 a.m.
since 94310cb we've been able to soft offline 1G hugepages at the PGD
level, however x86_64 gigantic hugepages are at the PUD level so we
should add an extra check to account for hstate order at PUD level.

I'm not sure if this also applies to 5 level page tables on x86_64
however. Tested with 4 level pagetable.

Signed-off-by: Alexandru Moise <00moses.alexander00@gmail.com>
---
 include/linux/hugetlb.h | 1 +
 1 file changed, 1 insertion(+)
Kirill A. Shutemov - Sept. 29, 2017, 1:55 p.m.
On Wed, Sep 13, 2017 at 12:10:47PM +0200, Alexandru Moise wrote:
> since 94310cb we've been able to soft offline 1G hugepages at the PGD
> level, however x86_64 gigantic hugepages are at the PUD level so we
> should add an extra check to account for hstate order at PUD level.

Have you tested other cases affected by the change? It allows migration of
1G pages in general, which might be problematic.

It also makes these pages allocated with GFP_HIGHUSER_MOVABLE instead of
GFP_HIGHUSER. Any side effects there we should consider?

> I'm not sure if this also applies to 5 level page tables on x86_64
> however. Tested with 4 level pagetable.

There's nothing changed in this regard in 5-level paging mode. PUD is
still one gig and there are no new page sizes.

Patch

diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 8bbbd37ab105..86c3f3d9da0a 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -480,6 +480,7 @@  static inline bool hugepage_migration_supported(struct hstate *h)
 {
 #ifdef CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION
 	if ((huge_page_shift(h) == PMD_SHIFT) ||
+		(huge_page_shift(h) == PUD_SHIFT) ||
 		(huge_page_shift(h) == PGDIR_SHIFT))
 		return true;
 	else