提交 4e6af67e 编写于 作者: A Andrea Arcangeli 提交者: Linus Torvalds

thp: clear page compound

split_huge_page must transform a compound page to a regular page and needs
ClearPageCompound.
Signed-off-by: NAndrea Arcangeli <aarcange@redhat.com>
Acked-by: NRik van Riel <riel@redhat.com>
Reviewed-by: NChristoph Lameter <cl@linux-foundation.org>
Acked-by: NMel Gorman <mel@csn.ul.ie>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 91a4ee26
...@@ -347,7 +347,7 @@ static inline void set_page_writeback(struct page *page) ...@@ -347,7 +347,7 @@ static inline void set_page_writeback(struct page *page)
* tests can be used in performance sensitive paths. PageCompound is * tests can be used in performance sensitive paths. PageCompound is
* generally not used in hot code paths. * generally not used in hot code paths.
*/ */
__PAGEFLAG(Head, head) __PAGEFLAG(Head, head) CLEARPAGEFLAG(Head, head)
__PAGEFLAG(Tail, tail) __PAGEFLAG(Tail, tail)
static inline int PageCompound(struct page *page) static inline int PageCompound(struct page *page)
...@@ -355,6 +355,13 @@ static inline int PageCompound(struct page *page) ...@@ -355,6 +355,13 @@ static inline int PageCompound(struct page *page)
return page->flags & ((1L << PG_head) | (1L << PG_tail)); return page->flags & ((1L << PG_head) | (1L << PG_tail));
} }
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
static inline void ClearPageCompound(struct page *page)
{
BUG_ON(!PageHead(page));
ClearPageHead(page);
}
#endif
#else #else
/* /*
* Reduce page flag use as much as possible by overlapping * Reduce page flag use as much as possible by overlapping
...@@ -392,6 +399,14 @@ static inline void __ClearPageTail(struct page *page) ...@@ -392,6 +399,14 @@ static inline void __ClearPageTail(struct page *page)
page->flags &= ~PG_head_tail_mask; page->flags &= ~PG_head_tail_mask;
} }
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
static inline void ClearPageCompound(struct page *page)
{
BUG_ON((page->flags & PG_head_tail_mask) != (1 << PG_compound));
clear_bit(PG_compound, &page->flags);
}
#endif
#endif /* !PAGEFLAGS_EXTENDED */ #endif /* !PAGEFLAGS_EXTENDED */
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册