Index: linux-2.6.25-rc8-mm2/include/linux/slub_def.h =================================================================== --- linux-2.6.25-rc8-mm2.orig/include/linux/slub_def.h 2008-04-11 20:17:36.000000000 -0700 +++ linux-2.6.25-rc8-mm2/include/linux/slub_def.h 2008-04-11 20:18:01.000000000 -0700 @@ -81,6 +81,7 @@ struct kmem_cache { int size; /* The size of an object including meta data */ int objsize; /* The size of an object without meta data */ int offset; /* Free pointer offset. */ + int vmcounter; /* VM counter that accounts allocations */ struct kmem_cache_order_objects oo; /* Index: linux-2.6.25-rc8-mm2/mm/slub.c =================================================================== --- linux-2.6.25-rc8-mm2.orig/mm/slub.c 2008-04-11 20:18:04.000000000 -0700 +++ linux-2.6.25-rc8-mm2/mm/slub.c 2008-04-11 20:19:45.000000000 -0700 @@ -1142,10 +1142,7 @@ static struct page *allocate_slab(struct stat(get_cpu_slab(s, raw_smp_processor_id()), ORDER_FALLBACK); } page->objects = oo_objects(oo); - inc_zone_page_state(page, - (s->flags & SLAB_RECLAIM_ACCOUNT) ? - NR_SLAB_RECLAIMABLE : NR_SLAB_UNRECLAIMABLE); - + inc_zone_page_state(page, s->vmcounter); return page; } @@ -1213,10 +1210,7 @@ static void __free_slab(struct kmem_cach ClearSlabDebug(page); } - dec_zone_page_state(page, - (s->flags & SLAB_RECLAIM_ACCOUNT) ? - NR_SLAB_RECLAIMABLE : NR_SLAB_UNRECLAIMABLE); - + dec_zone_page_state(page, s->vmcounter); ClearSlabKickable(page); __ClearPageSlab(page); reset_page_mapcount(page); @@ -2335,6 +2329,11 @@ static int calculate_sizes(struct kmem_c if (oo_objects(s->oo) > oo_objects(s->max)) s->max = s->oo; + if (s->flags & SLAB_RECLAIM_ACCOUNT) + s->vmcounter = NR_SLAB_RECLAIMABLE; + else + s->vmcounter = NR_SLAB_UNRECLAIMABLE; + return !!oo_objects(s->oo); }