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
259 return NULL;259 return NULL;
260}260}
261 261
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 */
266static inline struct page *thp_head(struct page *page)
267{
268 return compound_head(page);
269}
270
262/**271/**
263 * thp_order - Order of a transparent huge page.272 * thp_order - Order of a transparent huge page.
264 * @page: Head page of a transparent huge page.273 * @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
335#define HPAGE_PUD_MASK ({ BUILD_BUG(); 0; })344#define HPAGE_PUD_MASK ({ BUILD_BUG(); 0; })
336#define HPAGE_PUD_SIZE ({ BUILD_BUG(); 0; })345#define HPAGE_PUD_SIZE ({ BUILD_BUG(); 0; })
337 346
347static inline struct page *thp_head(struct page *page)
348{
349 VM_BUG_ON_PGFLAGS(PageTail(page), page);
350 return page;
351}
352
338static inline unsigned int thp_order(struct page *page)353static inline unsigned int thp_order(struct page *page)
339{354{
340 VM_BUG_ON_PGFLAGS(PageTail(page), page);355 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