Re: [PATCH] mm,slab,memcg: call memcg kmem put cache with same condition as get

2019-01-09 Thread Rik van Riel
On Tue, 2019-01-08 at 21:36 -0800, Shakeel Butt wrote: > On Tue, Jan 8, 2019 at 8:01 PM Rik van Riel wrote: > > > > There is an imbalance between when slab_pre_alloc_hook calls > > memcg_kmem_get_cache and when slab_post_alloc_hook calls > > memcg_kmem_put_cache. > > > > Can you explain how

Re: [PATCH] mm,slab,memcg: call memcg kmem put cache with same condition as get

2019-01-08 Thread Shakeel Butt
On Tue, Jan 8, 2019 at 9:36 PM Shakeel Butt wrote: > > On Tue, Jan 8, 2019 at 8:01 PM Rik van Riel wrote: > > > > There is an imbalance between when slab_pre_alloc_hook calls > > memcg_kmem_get_cache and when slab_post_alloc_hook calls > > memcg_kmem_put_cache. > > > > Can you explain how there

Re: [PATCH] mm,slab,memcg: call memcg kmem put cache with same condition as get

2019-01-08 Thread Shakeel Butt
On Tue, Jan 8, 2019 at 8:01 PM Rik van Riel wrote: > > There is an imbalance between when slab_pre_alloc_hook calls > memcg_kmem_get_cache and when slab_post_alloc_hook calls > memcg_kmem_put_cache. > Can you explain how there is an imbalance? If the returned kmem cache from

[PATCH] mm,slab,memcg: call memcg kmem put cache with same condition as get

2019-01-08 Thread Rik van Riel
There is an imbalance between when slab_pre_alloc_hook calls memcg_kmem_get_cache and when slab_post_alloc_hook calls memcg_kmem_put_cache. This can cause a memcg kmem cache to be destroyed right as an object from that cache is being allocated, which is probably not good. It could lead to things