Merge tag 'amd-drm-fixes-5.9-2020-08-20' of git://people.freedesktop.org/~agd5f/linux...
[linux-2.6-microblaze.git] / mm / slab.c
index 0dd6956..3160dff 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1249,7 +1249,6 @@ void __init kmem_cache_init(void)
                                  nr_node_ids * sizeof(struct kmem_cache_node *),
                                  SLAB_HWCACHE_ALIGN, 0, 0);
        list_add(&kmem_cache->list, &slab_caches);
-       memcg_link_cache(kmem_cache);
        slab_state = PARTIAL;
 
        /*
@@ -1380,11 +1379,7 @@ static struct page *kmem_getpages(struct kmem_cache *cachep, gfp_t flags,
                return NULL;
        }
 
-       if (charge_slab_page(page, flags, cachep->gfporder, cachep)) {
-               __free_pages(page, cachep->gfporder);
-               return NULL;
-       }
-
+       account_slab_page(page, cachep->gfporder, cachep);
        __SetPageSlab(page);
        /* Record if ALLOC_NO_WATERMARKS was set when allocating the slab */
        if (sk_memalloc_socks() && page_is_pfmemalloc(page))
@@ -1408,7 +1403,7 @@ static void kmem_freepages(struct kmem_cache *cachep, struct page *page)
 
        if (current->reclaim_state)
                current->reclaim_state->reclaimed_slab += 1 << order;
-       uncharge_slab_page(page, order, cachep);
+       unaccount_slab_page(page, order, cachep);
        __free_pages(page, order);
 }
 
@@ -3800,8 +3795,8 @@ fail:
 }
 
 /* Always called with the slab_mutex held */
-static int __do_tune_cpucache(struct kmem_cache *cachep, int limit,
-                               int batchcount, int shared, gfp_t gfp)
+static int do_tune_cpucache(struct kmem_cache *cachep, int limit,
+                           int batchcount, int shared, gfp_t gfp)
 {
        struct array_cache __percpu *cpu_cache, *prev;
        int cpu;
@@ -3846,30 +3841,6 @@ setup_node:
        return setup_kmem_cache_nodes(cachep, gfp);
 }
 
-static int do_tune_cpucache(struct kmem_cache *cachep, int limit,
-                               int batchcount, int shared, gfp_t gfp)
-{
-       int ret;
-       struct kmem_cache *c;
-
-       ret = __do_tune_cpucache(cachep, limit, batchcount, shared, gfp);
-
-       if (slab_state < FULL)
-               return ret;
-
-       if ((ret < 0) || !is_root_cache(cachep))
-               return ret;
-
-       lockdep_assert_held(&slab_mutex);
-       c = memcg_cache(cachep);
-       if (c) {
-               /* return value determined by the root cache only */
-               __do_tune_cpucache(c, limit, batchcount, shared, gfp);
-       }
-
-       return ret;
-}
-
 /* Called with slab_mutex held always */
 static int enable_cpucache(struct kmem_cache *cachep, gfp_t gfp)
 {
@@ -3882,13 +3853,6 @@ static int enable_cpucache(struct kmem_cache *cachep, gfp_t gfp)
        if (err)
                goto end;
 
-       if (!is_root_cache(cachep)) {
-               struct kmem_cache *root = memcg_root_cache(cachep);
-               limit = root->limit;
-               shared = root->shared;
-               batchcount = root->batchcount;
-       }
-
        if (limit && shared && batchcount)
                goto skip_setup;
        /*