From 92dd8ddaf9be90956231bf39222c78b307ff9a45 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Wed, 25 Jul 2007 20:05:38 -0700 Subject: [PATCH] compound_vmstat_slub 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(-) diff --git a/mm/slub.c b/mm/slub.c index 8df3ec1..8a62e0d 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1037,7 +1037,6 @@ static inline void kmem_cache_open_debug_check(struct kmem_cache *s) {} 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; @@ -1053,10 +1052,9 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node) 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; } @@ -1123,8 +1121,6 @@ out: static void __free_slab(struct kmem_cache *s, struct page *page) { - int pages = 1 << s->order; - if (unlikely(SlabDebug(page))) { void *p; @@ -1133,10 +1129,9 @@ static void __free_slab(struct kmem_cache *s, struct page *page) check_object(s, page, p, 0); } - 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); -- 1.4.4.4