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

Showing the changes to include/linux (1 of 1 file). Show all

Unified · Split

include/linux/hugetlb.h+13−2
@@ -493,18 +493,29 @@ static inline pgoff_t basepage_index(struct page *page) · 492 unmodified lines
493extern int dissolve_free_huge_page(struct page *page);493extern int dissolve_free_huge_page(struct page *page);
494extern int dissolve_free_huge_pages(unsigned long start_pfn,494extern int dissolve_free_huge_pages(unsigned long start_pfn,
495 unsigned long end_pfn);495 unsigned long end_pfn);
496static inline bool hugepage_migration_supported(struct hstate *h)496
497{
498#ifdef CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION497#ifdef CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION
498#ifndef arch_hugetlb_migration_supported
499static inline bool arch_hugetlb_migration_supported(struct hstate *h)
500{
499 if ((huge_page_shift(h) == PMD_SHIFT) ||501 if ((huge_page_shift(h) == PMD_SHIFT) ||
500 (huge_page_shift(h) == PUD_SHIFT) ||502 (huge_page_shift(h) == PUD_SHIFT) ||
501 (huge_page_shift(h) == PGDIR_SHIFT))503 (huge_page_shift(h) == PGDIR_SHIFT))
502 return true;504 return true;
503 else505 else
504 return false;506 return false;
507}
508#endif
505#else509#else
510static inline bool arch_hugetlb_migration_supported(struct hstate *h)
511{
506 return false;512 return false;
513}
507#endif514#endif
515
516static inline bool hugepage_migration_supported(struct hstate *h)
517{
518 return arch_hugetlb_migration_supported(h);
508}519}
509 520
510/*521/*

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