From 70d890ec1b3c60af9dd3ba8662663089f15a7065 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Wed, 25 Jul 2007 20:05:38 -0700 Subject: [PATCH] compound pages: Use new compound vmstat functions in SLUB Use the new dec/inc functions to simplify SLUB's accounting of pages. Signed-off-by: Christoph Lameter --- mm/slub.c | 13 ++++--------- 1 files changed, 4 insertions(+), 9 deletions(-) Index: linux-2.6.25-rc8-mm2/mm/slub.c =================================================================== --- linux-2.6.25-rc8-mm2.orig/mm/slub.c 2008-04-11 20:08:14.000000000 -0700 +++ linux-2.6.25-rc8-mm2/mm/slub.c 2008-04-11 20:15:03.000000000 -0700 @@ -1142,10 +1142,9 @@ static struct page *allocate_slab(struct stat(get_cpu_slab(s, raw_smp_processor_id()), ORDER_FALLBACK); } page->objects = oo_objects(oo); - mod_zone_page_state(page_zone(page), + inc_zone_page_state(page, (s->flags & SLAB_RECLAIM_ACCOUNT) ? - NR_SLAB_RECLAIMABLE : NR_SLAB_UNRECLAIMABLE, - 1 << oo_order(oo)); + NR_SLAB_RECLAIMABLE : NR_SLAB_UNRECLAIMABLE); return page; } @@ -1204,9 +1203,6 @@ out: static void __free_slab(struct kmem_cache *s, struct page *page) { - int order = compound_order(page); - int pages = 1 << order; - if (unlikely(SlabDebug(page))) { void *p; @@ -1217,15 +1213,14 @@ static void __free_slab(struct kmem_cach ClearSlabDebug(page); } - mod_zone_page_state(page_zone(page), + dec_zone_page_state(page, (s->flags & SLAB_RECLAIM_ACCOUNT) ? - NR_SLAB_RECLAIMABLE : NR_SLAB_UNRECLAIMABLE, - -pages); + NR_SLAB_RECLAIMABLE : NR_SLAB_UNRECLAIMABLE); ClearSlabKickable(page); __ClearPageSlab(page); reset_page_mapcount(page); - __free_pages(page, order); + __free_pages(page, compound_order(page)); } static void rcu_free_slab(struct rcu_head *h)