Compound pages: Use mapcount of first pageto store page order Use the mapcount field to store the page order. That frees up lru.prev for other purposes. Signed-off-by: Christoph Lameter --- include/linux/mm.h | 4 ++-- mm/page_alloc.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) Index: linux-2.6/include/linux/mm.h =================================================================== --- linux-2.6.orig/include/linux/mm.h 2007-09-28 06:33:58.000000000 -0700 +++ linux-2.6/include/linux/mm.h 2007-09-28 06:38:22.000000000 -0700 @@ -355,12 +355,12 @@ static inline int compound_order(struct { if (!PageHead(page)) return 0; - return (unsigned long)page[1].lru.prev; + return atomic_read(&page[1]._mapcount); } static inline void set_compound_order(struct page *page, unsigned long order) { - page[1].lru.prev = (void *)order; + atomic_set(&page[1]._mapcount, order); } /* Index: linux-2.6/mm/page_alloc.c =================================================================== --- linux-2.6.orig/mm/page_alloc.c 2007-09-28 06:35:46.000000000 -0700 +++ linux-2.6/mm/page_alloc.c 2007-09-28 06:36:25.000000000 -0700 @@ -269,6 +269,7 @@ static void destroy_compound_page(struct if (unlikely(!PageHead(page))) bad_page(page); __ClearPageHead(page); + reset_page_mapcount(page + 1); for (i = 1; i < nr_pages; i++) { struct page *p = page + i;