]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - mm/slub.c
Merge tag 'pci-v3.16-changes-2' of git://git.kernel.org/pub/scm/linux/kernel/git...
[karo-tx-linux.git] / mm / slub.c
index fc9831851be6a5ee03347dc868832894f66a927d..b2b047327d761a46802377b407d992ace14358bc 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1422,7 +1422,6 @@ static struct page *new_slab(struct kmem_cache *s, gfp_t flags, int node)
 
        order = compound_order(page);
        inc_slabs_node(s, page_to_nid(page), page->objects);
-       memcg_bind_pages(s, order);
        page->slab_cache = s;
        __SetPageSlab(page);
        if (page->pfmemalloc)
@@ -1473,7 +1472,6 @@ static void __free_slab(struct kmem_cache *s, struct page *page)
        __ClearPageSlabPfmemalloc(page);
        __ClearPageSlab(page);
 
-       memcg_release_pages(s, order);
        page_mapcount_reset(page);
        if (current->reclaim_state)
                current->reclaim_state->reclaimed_slab += pages;
@@ -1728,7 +1726,7 @@ static void *get_partial(struct kmem_cache *s, gfp_t flags, int node,
                struct kmem_cache_cpu *c)
 {
        void *object;
-       int searchnode = (node == NUMA_NO_NODE) ? numa_node_id() : node;
+       int searchnode = (node == NUMA_NO_NODE) ? numa_mem_id() : node;
 
        object = get_partial_node(s, get_node(s, searchnode), c, flags);
        if (object || node != NUMA_NO_NODE)
@@ -2211,7 +2209,7 @@ static inline void *new_slab_objects(struct kmem_cache *s, gfp_t flags,
 
        page = new_slab(s, flags, node);
        if (page) {
-               c = __this_cpu_ptr(s->cpu_slab);
+               c = raw_cpu_ptr(s->cpu_slab);
                if (c->page)
                        flush_slab(s, c);
 
@@ -2427,7 +2425,7 @@ redo:
         * and the retrieval of the tid.
         */
        preempt_disable();
-       c = __this_cpu_ptr(s->cpu_slab);
+       c = this_cpu_ptr(s->cpu_slab);
 
        /*
         * The transaction ids are globally unique per cpu and per operation on
@@ -2683,7 +2681,7 @@ redo:
         * during the cmpxchg then the free will succedd.
         */
        preempt_disable();
-       c = __this_cpu_ptr(s->cpu_slab);
+       c = this_cpu_ptr(s->cpu_slab);
 
        tid = c->tid;
        preempt_enable();
@@ -3311,8 +3309,8 @@ static void *kmalloc_large_node(size_t size, gfp_t flags, int node)
        struct page *page;
        void *ptr = NULL;
 
-       flags |= __GFP_COMP | __GFP_NOTRACK | __GFP_KMEMCG;
-       page = alloc_pages_node(node, flags, get_order(size));
+       flags |= __GFP_COMP | __GFP_NOTRACK;
+       page = alloc_kmem_pages_node(node, flags, get_order(size));
        if (page)
                ptr = page_address(page);
 
@@ -3381,7 +3379,7 @@ void kfree(const void *x)
        if (unlikely(!PageSlab(page))) {
                BUG_ON(!PageCompound(page));
                kfree_hook(x);
-               __free_memcg_kmem_pages(page, compound_order(page));
+               __free_kmem_pages(page, compound_order(page));
                return;
        }
        slab_free(page->slab_cache, page, object, _RET_IP_);
@@ -3398,7 +3396,7 @@ EXPORT_SYMBOL(kfree);
  * being allocated from last increasing the chance that the last objects
  * are freed in them.
  */
-int kmem_cache_shrink(struct kmem_cache *s)
+int __kmem_cache_shrink(struct kmem_cache *s)
 {
        int node;
        int i;
@@ -3454,7 +3452,6 @@ int kmem_cache_shrink(struct kmem_cache *s)
        kfree(slabs_by_inuse);
        return 0;
 }
-EXPORT_SYMBOL(kmem_cache_shrink);
 
 static int slab_mem_going_offline_callback(void *arg)
 {
@@ -3462,7 +3459,7 @@ static int slab_mem_going_offline_callback(void *arg)
 
        mutex_lock(&slab_mutex);
        list_for_each_entry(s, &slab_caches, list)
-               kmem_cache_shrink(s);
+               __kmem_cache_shrink(s);
        mutex_unlock(&slab_mutex);
 
        return 0;
@@ -4332,7 +4329,7 @@ static ssize_t show_slab_objects(struct kmem_cache *s,
                }
        }
 
-       lock_memory_hotplug();
+       get_online_mems();
 #ifdef CONFIG_SLUB_DEBUG
        if (flags & SO_ALL) {
                for_each_node_state(node, N_NORMAL_MEMORY) {
@@ -4372,7 +4369,7 @@ static ssize_t show_slab_objects(struct kmem_cache *s,
                        x += sprintf(buf + x, " N%d=%lu",
                                        node, nodes[node]);
 #endif
-       unlock_memory_hotplug();
+       put_online_mems();
        kfree(nodes);
        return x + sprintf(buf + x, "\n");
 }