History

mm/hugetlb: enable arch specific huge page size support for migration

Architectures like arm64 have HugeTLB page sizes which are different than generic sizes at PMD, PUD, PGD level and implemented via contiguous bits. At present these special size HugeTLB pages cannot be identified through macros like (PMD|PUD|PGDIR)_SHIFT and hence chosen not be migrated. Enabling migration support for these special HugeTLB page sizes along with the generic ones (PMD|PUD|PGD) would require identifying all of them on a given platform. A platform specific hook can precisely enumerate all huge page sizes supported for migration. Instead of comparing against standard huge page orders let hugetlb_migration_support() function call a platform hook arch_hugetlb_migration_support(). Default definition for the platform hook maintains existing semantics which checks standard huge page order. But an architecture can choose to override the default and provide support for a comprehensive set of huge page sizes.

Anshuman Khandual committed 7 years ago

Commit e693de11 parent 9b553bf1 file · +13 −2Browse files

Unified · Split

include/linux/hugetlb.h+13−2
@@ -493,18 +493,29 @@ static inline pgoff_t basepage_index(struct page *page) · 492 unmodified lines
493493 extern int dissolve_free_huge_page(struct page *page);
494494 extern int dissolve_free_huge_pages(unsigned long start_pfn,
495495 unsigned long end_pfn);
496−static inline bool hugepage_migration_supported(struct hstate *h)
497−{
496+
498497 #ifdef CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION
498+#ifndef arch_hugetlb_migration_supported
499+static inline bool arch_hugetlb_migration_supported(struct hstate *h)
500+{
499501 if ((huge_page_shift(h) == PMD_SHIFT) ||
500502 (huge_page_shift(h) == PUD_SHIFT) ||
501503 (huge_page_shift(h) == PGDIR_SHIFT))
502504 return true;
503505 else
504506 return false;
507+}
508+#endif
505509 #else
510+static inline bool arch_hugetlb_migration_supported(struct hstate *h)
511+{
506512 return false;
513+}
507514 #endif
515+
516+static inline bool hugepage_migration_supported(struct hstate *h)
517+{
518+ return arch_hugetlb_migration_supported(h);
508519 }
509520
510521 /*

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t