From 6bf92897897d4b3bfe2888c42e7c439c3725c457 Mon Sep 17 00:00:00 2001 From: Andrea Arcangeli Date: Thu, 13 Jan 2011 15:46:44 -0800 Subject: [PATCH] --- yaml --- r: 230763 b: refs/heads/master c: 4e6af67e970a2ac287739a4c526c857b5bda27ec h: refs/heads/master i: 230761: f48b945ae83af55ae1f6c642420831924ddda586 230759: c931544023b758cc6d0cef79dd440b6c7f8fd90e v: v3 --- [refs] | 2 +- trunk/include/linux/page-flags.h | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 9566feaca938..3c95cf7fab16 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 91a4ee2670e0ee2b0630a0eb24fb9a87ea3acd0a +refs/heads/master: 4e6af67e970a2ac287739a4c526c857b5bda27ec diff --git a/trunk/include/linux/page-flags.h b/trunk/include/linux/page-flags.h index 5a743cc87238..4835cae71047 100644 --- a/trunk/include/linux/page-flags.h +++ b/trunk/include/linux/page-flags.h @@ -347,7 +347,7 @@ static inline void set_page_writeback(struct page *page) * tests can be used in performance sensitive paths. PageCompound is * generally not used in hot code paths. */ -__PAGEFLAG(Head, head) +__PAGEFLAG(Head, head) CLEARPAGEFLAG(Head, head) __PAGEFLAG(Tail, tail) 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)); } +#ifdef CONFIG_TRANSPARENT_HUGEPAGE +static inline void ClearPageCompound(struct page *page) +{ + BUG_ON(!PageHead(page)); + ClearPageHead(page); +} +#endif #else /* * Reduce page flag use as much as possible by overlapping @@ -392,6 +399,14 @@ static inline void __ClearPageTail(struct page *page) 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 */ #ifdef CONFIG_MMU