memcg/sl[au]b: track all the memcg children of a kmem_cache
[~shefty/rdma-dev.git] / mm / slab_common.c
index 1c424b6511bfec86558a7feff64198b11a7edc35..080a43804bf1aa11fd50e9ee249416ed0b9c1f11 100644 (file)
@@ -249,6 +249,9 @@ EXPORT_SYMBOL(kmem_cache_create);
 
 void kmem_cache_destroy(struct kmem_cache *s)
 {
+       /* Destroy all the children caches if we aren't a memcg cache */
+       kmem_cache_destroy_memcg_children(s);
+
        get_online_cpus();
        mutex_lock(&slab_mutex);
        s->refcount--;