diff options
Diffstat (limited to 'include/linux/page-flags.h')
-rw-r--r-- | include/linux/page-flags.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index f4ed4f1b0c77..6b052aa7b5b7 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -517,6 +517,27 @@ static inline int PageTransCompound(struct page *page) | |||
517 | } | 517 | } |
518 | 518 | ||
519 | /* | 519 | /* |
520 | * PageTransCompoundMap is the same as PageTransCompound, but it also | ||
521 | * guarantees the primary MMU has the entire compound page mapped | ||
522 | * through pmd_trans_huge, which in turn guarantees the secondary MMUs | ||
523 | * can also map the entire compound page. This allows the secondary | ||
524 | * MMUs to call get_user_pages() only once for each compound page and | ||
525 | * to immediately map the entire compound page with a single secondary | ||
526 | * MMU fault. If there will be a pmd split later, the secondary MMUs | ||
527 | * will get an update through the MMU notifier invalidation through | ||
528 | * split_huge_pmd(). | ||
529 | * | ||
530 | * Unlike PageTransCompound, this is safe to be called only while | ||
531 | * split_huge_pmd() cannot run from under us, like if protected by the | ||
532 | * MMU notifier, otherwise it may result in page->_mapcount < 0 false | ||
533 | * positives. | ||
534 | */ | ||
535 | static inline int PageTransCompoundMap(struct page *page) | ||
536 | { | ||
537 | return PageTransCompound(page) && atomic_read(&page->_mapcount) < 0; | ||
538 | } | ||
539 | |||
540 | /* | ||
520 | * PageTransTail returns true for both transparent huge pages | 541 | * PageTransTail returns true for both transparent huge pages |
521 | * and hugetlbfs pages, so it should only be called when it's known | 542 | * and hugetlbfs pages, so it should only be called when it's known |
522 | * that hugetlbfs pages aren't involved. | 543 | * that hugetlbfs pages aren't involved. |
@@ -559,6 +580,7 @@ static inline int TestClearPageDoubleMap(struct page *page) | |||
559 | #else | 580 | #else |
560 | TESTPAGEFLAG_FALSE(TransHuge) | 581 | TESTPAGEFLAG_FALSE(TransHuge) |
561 | TESTPAGEFLAG_FALSE(TransCompound) | 582 | TESTPAGEFLAG_FALSE(TransCompound) |
583 | TESTPAGEFLAG_FALSE(TransCompoundMap) | ||
562 | TESTPAGEFLAG_FALSE(TransTail) | 584 | TESTPAGEFLAG_FALSE(TransTail) |
563 | TESTPAGEFLAG_FALSE(DoubleMap) | 585 | TESTPAGEFLAG_FALSE(DoubleMap) |
564 | TESTSETFLAG_FALSE(DoubleMap) | 586 | TESTSETFLAG_FALSE(DoubleMap) |