History

mm: add thp_head

This is like compound_head() but compiles away when CONFIG_TRANSPARENT_HUGEPAGE is not enabled.

Matthew Wilcox (Oracle) committed 6 years ago

Commit 2be1d711 parent 6c357841 file · +15 −0Browse files

Unified · Split

include/linux/huge_mm.h+15−0
@@ -259,6 +259,15 @@ static inline spinlock_t *pud_trans_huge_lock(pud_t *pud, · 258 unmodified lines
259259 return NULL;
260260 }
261261
262+/**
263+ * thp_head - Head page of a transparent huge page.
264+ * @page: Any page (tail, head or regular) found in the page cache.
265+ */
266+static inline struct page *thp_head(struct page *page)
267+{
268+ return compound_head(page);
269+}
270+
262271 /**
263272 * thp_order - Order of a transparent huge page.
264273 * @page: Head page of a transparent huge page.
@@ -335,6 +344,12 @@ static inline struct list_head *page_deferred_list(struct page *page) · 70 unmodified lines
335344 #define HPAGE_PUD_MASK ({ BUILD_BUG(); 0; })
336345 #define HPAGE_PUD_SIZE ({ BUILD_BUG(); 0; })
337346
347+static inline struct page *thp_head(struct page *page)
348+{
349+ VM_BUG_ON_PGFLAGS(PageTail(page), page);
350+ return page;
351+}
352+
338353 static inline unsigned int thp_order(struct page *page)
339354 {
340355 VM_BUG_ON_PGFLAGS(PageTail(page), page);

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