mm: memcontrol: fix cgroup creation failure after many small jobs
[cascardo/linux.git] / mm / slab_common.c
index 3239bfd..82317ab 100644 (file)
@@ -526,8 +526,8 @@ void memcg_create_kmem_cache(struct mem_cgroup *memcg,
                goto out_unlock;
 
        cgroup_name(css->cgroup, memcg_name_buf, sizeof(memcg_name_buf));
-       cache_name = kasprintf(GFP_KERNEL, "%s(%d:%s)", root_cache->name,
-                              css->id, memcg_name_buf);
+       cache_name = kasprintf(GFP_KERNEL, "%s(%llu:%s)", root_cache->name,
+                              css->serial_nr, memcg_name_buf);
        if (!cache_name)
                goto out_unlock;
 
@@ -715,6 +715,7 @@ void kmem_cache_destroy(struct kmem_cache *s)
        get_online_cpus();
        get_online_mems();
 
+       kasan_cache_destroy(s);
        mutex_lock(&slab_mutex);
 
        s->refcount--;
@@ -753,6 +754,7 @@ int kmem_cache_shrink(struct kmem_cache *cachep)
 
        get_online_cpus();
        get_online_mems();
+       kasan_cache_shrink(cachep);
        ret = __kmem_cache_shrink(cachep, false);
        put_online_mems();
        put_online_cpus();