diff options
author | Andrea Arcangeli <aarcange@redhat.com> | 2011-01-13 18:46:44 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 20:32:41 -0500 |
commit | 4e6af67e970a2ac287739a4c526c857b5bda27ec (patch) | |
tree | 2de1bcb20fb3ff136d6b65a651d06a572bfd677d | |
parent | 91a4ee2670e0ee2b0630a0eb24fb9a87ea3acd0a (diff) |
thp: clear page compound
split_huge_page must transform a compound page to a regular page and needs
ClearPageCompound.
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: Rik van Riel <riel@redhat.com>
Reviewed-by: Christoph Lameter <cl@linux-foundation.org>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | include/linux/page-flags.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 5a743cc87238..4835cae71047 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -347,7 +347,7 @@ static inline void set_page_writeback(struct page *page) | |||
347 | * tests can be used in performance sensitive paths. PageCompound is | 347 | * tests can be used in performance sensitive paths. PageCompound is |
348 | * generally not used in hot code paths. | 348 | * generally not used in hot code paths. |
349 | */ | 349 | */ |
350 | __PAGEFLAG(Head, head) | 350 | __PAGEFLAG(Head, head) CLEARPAGEFLAG(Head, head) |
351 | __PAGEFLAG(Tail, tail) | 351 | __PAGEFLAG(Tail, tail) |
352 | 352 | ||
353 | static inline int PageCompound(struct page *page) | 353 | static inline int PageCompound(struct page *page) |
@@ -355,6 +355,13 @@ static inline int PageCompound(struct page *page) | |||
355 | return page->flags & ((1L << PG_head) | (1L << PG_tail)); | 355 | return page->flags & ((1L << PG_head) | (1L << PG_tail)); |
356 | 356 | ||
357 | } | 357 | } |
358 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
359 | static inline void ClearPageCompound(struct page *page) | ||
360 | { | ||
361 | BUG_ON(!PageHead(page)); | ||
362 | ClearPageHead(page); | ||
363 | } | ||
364 | #endif | ||
358 | #else | 365 | #else |
359 | /* | 366 | /* |
360 | * Reduce page flag use as much as possible by overlapping | 367 | * Reduce page flag use as much as possible by overlapping |
@@ -392,6 +399,14 @@ static inline void __ClearPageTail(struct page *page) | |||
392 | page->flags &= ~PG_head_tail_mask; | 399 | page->flags &= ~PG_head_tail_mask; |
393 | } | 400 | } |
394 | 401 | ||
402 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
403 | static inline void ClearPageCompound(struct page *page) | ||
404 | { | ||
405 | BUG_ON((page->flags & PG_head_tail_mask) != (1 << PG_compound)); | ||
406 | clear_bit(PG_compound, &page->flags); | ||
407 | } | ||
408 | #endif | ||
409 | |||
395 | #endif /* !PAGEFLAGS_EXTENDED */ | 410 | #endif /* !PAGEFLAGS_EXTENDED */ |
396 | 411 | ||
397 | #ifdef CONFIG_MMU | 412 | #ifdef CONFIG_MMU |