memory_hotplug: introduce memhp_default_state= command line parameter
[deliverable/linux.git] / mm / slub.c
index 7277413ebc8b9a75806fba91103f57557b248cc3..cf1faa4d3992520ead5dd61deed5e7c41ef9175a 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -329,8 +329,8 @@ static inline void set_page_slub_counters(struct page *page, unsigned long count
        tmp.counters = counters_new;
        /*
         * page->counters can cover frozen/inuse/objects as well
-        * as page->_count.  If we assign to ->counters directly
-        * we run the risk of losing updates to page->_count, so
+        * as page->_refcount.  If we assign to ->counters directly
+        * we run the risk of losing updates to page->_refcount, so
         * be careful and only assign to the fields we need.
         */
        page->frozen  = tmp.frozen;
@@ -1313,7 +1313,7 @@ static inline void dec_slabs_node(struct kmem_cache *s, int node,
 static inline void kmalloc_large_node_hook(void *ptr, size_t size, gfp_t flags)
 {
        kmemleak_alloc(ptr, size, 1, flags);
-       kasan_kmalloc_large(ptr, size);
+       kasan_kmalloc_large(ptr, size, flags);
 }
 
 static inline void kfree_hook(const void *x)
@@ -1735,11 +1735,11 @@ static void *get_any_partial(struct kmem_cache *s, gfp_t flags,
         * may return off node objects because partial slabs are obtained
         * from other nodes and filled up.
         *
-        * If /sys/kernel/slab/xx/defrag_ratio is set to 100 (which makes
-        * defrag_ratio = 1000) then every (well almost) allocation will
-        * first attempt to defrag slab caches on other nodes. This means
-        * scanning over all nodes to look for partial slabs which may be
-        * expensive if we do it every time we are trying to find a slab
+        * If /sys/kernel/slab/xx/remote_node_defrag_ratio is set to 100
+        * (which makes defrag_ratio = 1000) then every (well almost)
+        * allocation will first attempt to defrag slab caches on other nodes.
+        * This means scanning over all nodes to look for partial slabs which
+        * may be expensive if we do it every time we are trying to find a slab
         * with available objects.
         */
        if (!s->remote_node_defrag_ratio ||
@@ -2596,7 +2596,7 @@ void *kmem_cache_alloc_trace(struct kmem_cache *s, gfp_t gfpflags, size_t size)
 {
        void *ret = slab_alloc(s, gfpflags, _RET_IP_);
        trace_kmalloc(_RET_IP_, ret, size, s->size, gfpflags);
-       kasan_kmalloc(s, ret, size);
+       kasan_kmalloc(s, ret, size, gfpflags);
        return ret;
 }
 EXPORT_SYMBOL(kmem_cache_alloc_trace);
@@ -2624,7 +2624,7 @@ void *kmem_cache_alloc_node_trace(struct kmem_cache *s,
        trace_kmalloc_node(_RET_IP_, ret,
                           size, s->size, gfpflags, node);
 
-       kasan_kmalloc(s, ret, size);
+       kasan_kmalloc(s, ret, size, gfpflags);
        return ret;
 }
 EXPORT_SYMBOL(kmem_cache_alloc_node_trace);
@@ -3182,7 +3182,8 @@ static void early_kmem_cache_node_alloc(int node)
        init_object(kmem_cache_node, n, SLUB_RED_ACTIVE);
        init_tracking(kmem_cache_node, n);
 #endif
-       kasan_kmalloc(kmem_cache_node, n, sizeof(struct kmem_cache_node));
+       kasan_kmalloc(kmem_cache_node, n, sizeof(struct kmem_cache_node),
+                     GFP_KERNEL);
        init_kmem_cache_node(n);
        inc_slabs_node(kmem_cache_node, node, page->objects);
 
@@ -3561,7 +3562,7 @@ void *__kmalloc(size_t size, gfp_t flags)
 
        trace_kmalloc(_RET_IP_, ret, size, s->size, flags);
 
-       kasan_kmalloc(s, ret, size);
+       kasan_kmalloc(s, ret, size, flags);
 
        return ret;
 }
@@ -3606,7 +3607,7 @@ void *__kmalloc_node(size_t size, gfp_t flags, int node)
 
        trace_kmalloc_node(_RET_IP_, ret, size, s->size, flags, node);
 
-       kasan_kmalloc(s, ret, size);
+       kasan_kmalloc(s, ret, size, flags);
 
        return ret;
 }
@@ -3635,7 +3636,7 @@ size_t ksize(const void *object)
        size_t size = __ksize(object);
        /* We assume that ksize callers could use whole allocated area,
           so we need unpoison this area. */
-       kasan_krealloc(object, size);
+       kasan_krealloc(object, size, GFP_NOWAIT);
        return size;
 }
 EXPORT_SYMBOL(ksize);
@@ -3696,7 +3697,7 @@ int __kmem_cache_shrink(struct kmem_cache *s, bool deactivate)
                 * s->cpu_partial is checked locklessly (see put_cpu_partial),
                 * so we have to make sure the change is visible.
                 */
-               kick_all_cpus_sync();
+               synchronize_sched();
        }
 
        flush_all(s);
This page took 0.029211 seconds and 5 git commands to generate.