Re: [PATCH v3] mm: memcg/slab: fix memory leak at non-root kmem_cache destroy

2020-07-16 Thread Roman Gushchin
On Thu, Jul 16, 2020 at 07:21:42PM +0200, Vlastimil Babka wrote: > On 7/16/20 6:51 PM, Muchun Song wrote: > > If the kmem_cache refcount is greater than one, we should not > > mark the root kmem_cache as dying. If we mark the root kmem_cache > > dying incorrectly, the non-root kmem_cache can never

Re: [PATCH v3] mm: memcg/slab: fix memory leak at non-root kmem_cache destroy

2020-07-16 Thread Vlastimil Babka
On 7/16/20 6:51 PM, Muchun Song wrote: > If the kmem_cache refcount is greater than one, we should not > mark the root kmem_cache as dying. If we mark the root kmem_cache > dying incorrectly, the non-root kmem_cache can never be destroyed. > It resulted in memory leak when memcg was destroyed. We

[PATCH v3] mm: memcg/slab: fix memory leak at non-root kmem_cache destroy

2020-07-16 Thread Muchun Song
If the kmem_cache refcount is greater than one, we should not mark the root kmem_cache as dying. If we mark the root kmem_cache dying incorrectly, the non-root kmem_cache can never be destroyed. It resulted in memory leak when memcg was destroyed. We can use the following steps to reproduce. 1)