diff options
Diffstat (limited to 'include/linux/hugetlb.h')
-rw-r--r-- | include/linux/hugetlb.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 2e02c4ed1035..0393270466c3 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -381,6 +381,16 @@ static inline pgoff_t basepage_index(struct page *page) | |||
381 | 381 | ||
382 | extern void dissolve_free_huge_pages(unsigned long start_pfn, | 382 | extern void dissolve_free_huge_pages(unsigned long start_pfn, |
383 | unsigned long end_pfn); | 383 | unsigned long end_pfn); |
384 | int pmd_huge_support(void); | ||
385 | /* | ||
386 | * Currently hugepage migration is enabled only for pmd-based hugepage. | ||
387 | * This function will be updated when hugepage migration is more widely | ||
388 | * supported. | ||
389 | */ | ||
390 | static inline int hugepage_migration_support(struct hstate *h) | ||
391 | { | ||
392 | return pmd_huge_support() && (huge_page_shift(h) == PMD_SHIFT); | ||
393 | } | ||
384 | 394 | ||
385 | #else /* CONFIG_HUGETLB_PAGE */ | 395 | #else /* CONFIG_HUGETLB_PAGE */ |
386 | struct hstate {}; | 396 | struct hstate {}; |
@@ -409,6 +419,8 @@ static inline pgoff_t basepage_index(struct page *page) | |||
409 | return page->index; | 419 | return page->index; |
410 | } | 420 | } |
411 | #define dissolve_free_huge_pages(s, e) do {} while (0) | 421 | #define dissolve_free_huge_pages(s, e) do {} while (0) |
422 | #define pmd_huge_support() 0 | ||
423 | #define hugepage_migration_support(h) 0 | ||
412 | #endif /* CONFIG_HUGETLB_PAGE */ | 424 | #endif /* CONFIG_HUGETLB_PAGE */ |
413 | 425 | ||
414 | #endif /* _LINUX_HUGETLB_H */ | 426 | #endif /* _LINUX_HUGETLB_H */ |