summaryrefslogtreecommitdiffstats
path: root/mm/slab_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/slab_common.c')
-rw-r--r--mm/slab_common.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c
index e77b51eb7347..11857abf7057 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -215,7 +215,10 @@ kmem_cache_create_memcg(struct mem_cgroup *memcg, const char *name, size_t size,
s->align = calculate_alignment(flags, align, size);
s->ctor = ctor;
- s->name = kstrdup(name, GFP_KERNEL);
+ if (memcg)
+ s->name = memcg_create_cache_name(memcg, parent_cache);
+ else
+ s->name = kstrdup(name, GFP_KERNEL);
if (!s->name)
goto out_free_cache;