[PATCH -mm v3 5/7] memcg, slab: do not destroy children caches if parent has aliases

2014-02-19 Thread Vladimir Davydov
Currently we destroy children caches at the very beginning of kmem_cache_destroy(). This is wrong, because the root cache will not necessarily be destroyed in the end - if it has aliases (refcount > 0), kmem_cache_destroy() will simply decrement its refcount and return. In this case, at best we

[PATCH -mm v3 5/7] memcg, slab: do not destroy children caches if parent has aliases

2014-02-19 Thread Vladimir Davydov
Currently we destroy children caches at the very beginning of kmem_cache_destroy(). This is wrong, because the root cache will not necessarily be destroyed in the end - if it has aliases (refcount 0), kmem_cache_destroy() will simply decrement its refcount and return. In this case, at best we