]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - mm/slab.c
mm: memcontrol: account slab stats per lruvec
[mirror_ubuntu-bionic-kernel.git] / mm / slab.c
index a38634ed478e3d5967fc1465004a2f1521c6c2db..04dec48c3ed7a12af3fef4958e928d0ddc31b64e 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1425,11 +1425,9 @@ static struct page *kmem_getpages(struct kmem_cache *cachep, gfp_t flags,
 
        nr_pages = (1 << cachep->gfporder);
        if (cachep->flags & SLAB_RECLAIM_ACCOUNT)
-               add_node_page_state(page_pgdat(page),
-                       NR_SLAB_RECLAIMABLE, nr_pages);
+               mod_lruvec_page_state(page, NR_SLAB_RECLAIMABLE, nr_pages);
        else
-               add_node_page_state(page_pgdat(page),
-                       NR_SLAB_UNRECLAIMABLE, nr_pages);
+               mod_lruvec_page_state(page, NR_SLAB_UNRECLAIMABLE, nr_pages);
 
        __SetPageSlab(page);
        /* Record if ALLOC_NO_WATERMARKS was set when allocating the slab */
@@ -1459,11 +1457,9 @@ static void kmem_freepages(struct kmem_cache *cachep, struct page *page)
        kmemcheck_free_shadow(page, order);
 
        if (cachep->flags & SLAB_RECLAIM_ACCOUNT)
-               sub_node_page_state(page_pgdat(page),
-                               NR_SLAB_RECLAIMABLE, nr_freed);
+               mod_lruvec_page_state(page, NR_SLAB_RECLAIMABLE, -nr_freed);
        else
-               sub_node_page_state(page_pgdat(page),
-                               NR_SLAB_UNRECLAIMABLE, nr_freed);
+               mod_lruvec_page_state(page, NR_SLAB_UNRECLAIMABLE, -nr_freed);
 
        BUG_ON(!PageSlab(page));
        __ClearPageSlabPfmemalloc(page);