From: Christoph Lameter Subject: Compound pages: slab: simplify compound size determination Simplify the size calculation of a compound in slab by using compound_order(). Signed-off-by: Christoph Lameter --- mm/slab.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) Index: linux-2.6.25-rc5-mm1/mm/slab.c =================================================================== --- linux-2.6.25-rc5-mm1.orig/mm/slab.c 2008-03-26 20:24:22.966668784 -0700 +++ linux-2.6.25-rc5-mm1/mm/slab.c 2008-03-26 20:26:00.759167138 -0700 @@ -2742,10 +2742,7 @@ static void slab_map_pages(struct kmem_c page = virt_to_page(addr); - nr_pages = 1; - if (likely(!PageCompound(page))) - nr_pages <<= cache->gfporder; - + nr_pages = 1 << compound_order(page); do { page_set_cache(page, cache); page_set_slab(page, slab);