]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - mm/slab.c
[PATCH] zoned vm counters: conversion of nr_slab to per zone counter
[karo-tx-linux.git] / mm / slab.c
index 0c33820038cb95c809c57a29a62860a7749b00d8..5dcfb904480180a3cb7cbebf108a8d332306630a 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1507,7 +1507,7 @@ static void *kmem_getpages(struct kmem_cache *cachep, gfp_t flags, int nodeid)
        nr_pages = (1 << cachep->gfporder);
        if (cachep->flags & SLAB_RECLAIM_ACCOUNT)
                atomic_add(nr_pages, &slab_reclaim_pages);
-       add_page_state(nr_slab, nr_pages);
+       add_zone_page_state(page_zone(page), NR_SLAB, nr_pages);
        for (i = 0; i < nr_pages; i++)
                __SetPageSlab(page + i);
        return page_address(page);
@@ -1522,12 +1522,12 @@ static void kmem_freepages(struct kmem_cache *cachep, void *addr)
        struct page *page = virt_to_page(addr);
        const unsigned long nr_freed = i;
 
+       sub_zone_page_state(page_zone(page), NR_SLAB, nr_freed);
        while (i--) {
                BUG_ON(!PageSlab(page));
                __ClearPageSlab(page);
                page++;
        }
-       sub_page_state(nr_slab, nr_freed);
        if (current->reclaim_state)
                current->reclaim_state->reclaimed_slab += nr_freed;
        free_pages((unsigned long)addr, cachep->gfporder);