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 file changed, 4 insertions(+), 9 deletions(-) Index: mm/mm/slub.c =================================================================== --- mm.orig/mm/slub.c 2007-11-28 14:09:43.598227501 -0800 +++ mm/mm/slub.c 2007-11-28 14:14:39.217067916 -0800 @@ -1035,7 +1035,6 @@ static inline unsigned long kmem_cache_f static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node) { struct page *page; - int pages = 1 << s->order; if (s->order) flags |= __GFP_COMP; @@ -1054,10 +1053,9 @@ static struct page *allocate_slab(struct if (!page) return NULL; - mod_zone_page_state(page_zone(page), + inc_zone_page_state(page, (s->flags & SLAB_RECLAIM_ACCOUNT) ? - NR_SLAB_RECLAIMABLE : NR_SLAB_UNRECLAIMABLE, - pages); + NR_SLAB_RECLAIMABLE : NR_SLAB_UNRECLAIMABLE); return page; } @@ -1120,8 +1118,6 @@ out: static void __free_slab(struct kmem_cache *s, struct page *page) { - int pages = 1 << s->order; - if (unlikely(page->flags & SLABDEBUG)) { void *p; @@ -1131,10 +1127,9 @@ static void __free_slab(struct kmem_cach page->flags &= ~SLABDEBUG; } - 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); page->mapping = NULL; __free_pages(page, s->order);