Commit 2be1d718 authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by Linus Torvalds
Browse files

mm: add thp_head

This is like compound_head() but compiles away when

Signed-off-by: default avatarMatthew Wilcox (Oracle) <>
Signed-off-by: default avatarAndrew Morton <>
Reviewed-by: default avatarWilliam Kucharski <>
Reviewed-by: default avatarZi Yan <>
Cc: David Hildenbrand <>
Cc: Mike Kravetz <>
Cc: "Kirill A. Shutemov" <>

Signed-off-by: default avatarLinus Torvalds <>
parent 6c357848
......@@ -259,6 +259,15 @@ static inline spinlock_t *pud_trans_huge_lock(pud_t *pud,
return NULL;
* thp_head - Head page of a transparent huge page.
* @page: Any page (tail, head or regular) found in the page cache.
static inline struct page *thp_head(struct page *page)
return compound_head(page);
* thp_order - Order of a transparent huge page.
* @page: Head page of a transparent huge page.
......@@ -335,6 +344,12 @@ static inline struct list_head *page_deferred_list(struct page *page)
#define HPAGE_PUD_MASK ({ BUILD_BUG(); 0; })
#define HPAGE_PUD_SIZE ({ BUILD_BUG(); 0; })
static inline struct page *thp_head(struct page *page)
VM_BUG_ON_PGFLAGS(PageTail(page), page);
return page;
static inline unsigned int thp_order(struct page *page)
VM_BUG_ON_PGFLAGS(PageTail(page), page);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment