--- include/linux/page-flags.h | 34 +++++++--------------------------- mm/internal.h | 2 +- mm/page_alloc.c | 7 +------ 3 files changed, 9 insertions(+), 34 deletions(-) Index: linux-2.6.21-rc7-mm1/include/linux/page-flags.h =================================================================== --- linux-2.6.21-rc7-mm1.orig/include/linux/page-flags.h 2007-04-25 07:25:41.000000000 -0700 +++ linux-2.6.21-rc7-mm1/include/linux/page-flags.h 2007-04-25 07:28:44.000000000 -0700 @@ -220,36 +220,16 @@ static inline void SetPageUptodate(struc #define ClearPageLazyFree(page) clear_bit(PG_lazyfree, &(page)->flags) #define __ClearPageLazyFree(page) __clear_bit(PG_lazyfree, &(page)->flags) -#define PageCompound(page) test_bit(PG_compound, &(page)->flags) -#define __SetPageCompound(page) __set_bit(PG_compound, &(page)->flags) -#define __ClearPageCompound(page) __clear_bit(PG_compound, &(page)->flags) - -/* - * PG_reclaim is used in combination with PG_compound to mark the - * head and tail of a compound page - * - * PG_compound & PG_reclaim => Tail page - * PG_compound & ~PG_reclaim => Head page - */ - -#define PG_head_tail_mask ((1L << PG_compound) | (1L << PG_reclaim)) +#define PageHead(page) test_bit(PG_head, &(page)->flags) +#define __SetPageHead(page) __set_bit(PG_head, &(page)->flags) +#define __ClearPageHead(page) __clear_bit(PG_head, &(page)->flags) #define PageTail(page) test_bit(PG_tail, &(page->flags)) +#define __SetPageTail(page) __set_bit(PG_tail, &(page)->flags) +#define __ClearPageTail(page) __clear_bit(PG_tail, &(page)->flags) -static inline void __SetPageTail(struct page *page) -{ - page->flags |= PG_head_tail_mask; -} - -static inline void __ClearPageTail(struct page *page) -{ - page->flags &= ~PG_head_tail_mask; -} - -#define PageHead(page) ((page->flags & PG_head_tail_mask) \ - == (1L << PG_compound)) -#define __SetPageHead(page) __SetPageCompound(page) -#define __ClearPageHead(page) __ClearPageCompound(page) +#define PageCompound(page) ((page)->flags & \ + ((1L << PG_head) | (1L << PG_tail))) #ifdef CONFIG_SWAP #define PageSwapCache(page) test_bit(PG_swapcache, &(page)->flags) Index: linux-2.6.21-rc7-mm1/mm/internal.h =================================================================== --- linux-2.6.21-rc7-mm1.orig/mm/internal.h 2007-04-25 07:34:49.000000000 -0700 +++ linux-2.6.21-rc7-mm1/mm/internal.h 2007-04-25 07:34:57.000000000 -0700 @@ -24,7 +24,7 @@ static inline void set_page_count(struct */ static inline void set_page_refcounted(struct page *page) { - VM_BUG_ON(PageCompound(page) && PageTail(page)); + VM_BUG_ON(PageTail(page)); VM_BUG_ON(atomic_read(&page->_count)); set_page_count(page, 1); } Index: linux-2.6.21-rc7-mm1/mm/page_alloc.c =================================================================== --- linux-2.6.21-rc7-mm1.orig/mm/page_alloc.c 2007-04-25 07:29:20.000000000 -0700 +++ linux-2.6.21-rc7-mm1/mm/page_alloc.c 2007-04-25 07:30:27.000000000 -0700 @@ -485,18 +485,13 @@ static inline int free_pages_check(struc 1 << PG_private | 1 << PG_locked | 1 << PG_active | + 1 << PG_reclaim | 1 << PG_slab | 1 << PG_swapcache | 1 << PG_writeback | 1 << PG_reserved | 1 << PG_buddy )))) bad_page(page); - /* - * PageReclaim == PageTail. It is only an error - * for PageReclaim to be set if PageCompound is clear. - */ - if (unlikely(!PageCompound(page) && PageReclaim(page))) - bad_page(page); if (PageDirty(page)) __ClearPageDirty(page); if (PageLazyFree(page))