Index: linux-2.6.25-rc8-mm2/arch/ia64/mm/init.c
===================================================================
--- linux-2.6.25-rc8-mm2.orig/arch/ia64/mm/init.c	2008-04-11 20:08:55.000000000 -0700
+++ linux-2.6.25-rc8-mm2/arch/ia64/mm/init.c	2008-04-11 20:09:15.000000000 -0700
@@ -65,7 +65,7 @@ __ia64_sync_icache_dcache (pte_t pte)
 	if (test_bit(PG_arch_1, &page->flags))
 		return;				/* i-cache is already coherent with d-cache */
 
-	flush_icache_range(addr, addr + (PAGE_SIZE << compound_order(page)));
+	flush_icache_range(addr, addr + compound_size(page));
 	set_bit(PG_arch_1, &page->flags);	/* mark page as clean */
 }
 
Index: linux-2.6.25-rc8-mm2/include/linux/mm.h
===================================================================
--- linux-2.6.25-rc8-mm2.orig/include/linux/mm.h	2008-04-11 20:04:00.000000000 -0700
+++ linux-2.6.25-rc8-mm2/include/linux/mm.h	2008-04-11 20:13:14.000000000 -0700
@@ -333,6 +333,16 @@ static inline int compound_order(struct 
 	return (unsigned long)page[1].lru.prev;
 }
 
+static inline unsigned long compound_pages(struct page *page)
+{
+	return 1 << compound_order(page);
+}
+
+static inline unsigned long compound_size(struct page *page)
+{
+	return PAGE_SIZE << compound_order(page);
+}
+
 static inline void set_compound_order(struct page *page, unsigned long order)
 {
 	page[1].lru.prev = (void *)order;
Index: linux-2.6.25-rc8-mm2/mm/slub.c
===================================================================
--- linux-2.6.25-rc8-mm2.orig/mm/slub.c	2008-04-11 20:05:22.000000000 -0700
+++ linux-2.6.25-rc8-mm2/mm/slub.c	2008-04-12 16:35:15.000000000 -0700
@@ -680,7 +680,7 @@ static int slab_pad_check(struct kmem_ca
 		return 1;
 
 	start = page_address(page);
-	length = (PAGE_SIZE << compound_order(page));
+	length = compound_size(page);
 	end = start + length;
 	remainder = length % s->size;
 	if (!remainder)
@@ -764,7 +764,7 @@ static int check_slab(struct kmem_cache 
 		return 0;
 	}
 
-	maxobj = (PAGE_SIZE << compound_order(page)) / s->size;
+	maxobj = compound_size(page) / s->size;
 	if (page->objects > maxobj) {
 		slab_err(s, page, "objects %u > max %u",
 			s->name, page->objects, maxobj);
@@ -814,7 +814,7 @@ static int on_freelist(struct kmem_cache
 		nr++;
 	}
 
-	max_objects = (PAGE_SIZE << compound_order(page)) / s->size;
+	max_objects = compound_size(page) / s->size;
 	if (max_objects > 65535)
 		max_objects = 65535;
 
@@ -1185,7 +1185,7 @@ static struct page *new_slab(struct kmem
 	start = page_address(page);
 
 	if (unlikely(s->flags & SLAB_POISON))
-		memset(start, POISON_INUSE, PAGE_SIZE << compound_order(page));
+		memset(start, POISON_INUSE, compound_size(page));
 
 	last = start;
 	for_each_object(p, s, start, page->objects) {
@@ -2722,7 +2722,7 @@ size_t ksize(const void *object)
 	page = virt_to_head_page(object);
 
 	if (unlikely(!PageSlab(page)))
-		return PAGE_SIZE << compound_order(page);
+		return compound_size(page);
 
 	s = page->slab;