Re: [Devel] [PATCH 4/6] memcg, slab: check and init memcg_cahes under slab_mutex

2013-12-19 Thread Glauber Costa
On Thu, Dec 19, 2013 at 11:07 AM, Vladimir Davydov vdavy...@parallels.com wrote: On 12/18/2013 09:41 PM, Michal Hocko wrote: On Wed 18-12-13 17:16:55, Vladimir Davydov wrote: The memcg_params::memcg_caches array can be updated concurrently from memcg_update_cache_size() and

Re: [Devel] [PATCH 4/6] memcg, slab: check and init memcg_cahes under slab_mutex

2013-12-19 Thread Michal Hocko
On Thu 19-12-13 12:00:58, Glauber Costa wrote: On Thu, Dec 19, 2013 at 11:07 AM, Vladimir Davydov vdavy...@parallels.com wrote: On 12/18/2013 09:41 PM, Michal Hocko wrote: On Wed 18-12-13 17:16:55, Vladimir Davydov wrote: The memcg_params::memcg_caches array can be updated concurrently

Re: [Devel] [PATCH 4/6] memcg, slab: check and init memcg_cahes under slab_mutex

2013-12-19 Thread Vladimir Davydov
On 12/19/2013 01:12 PM, Michal Hocko wrote: On Thu 19-12-13 12:00:58, Glauber Costa wrote: On Thu, Dec 19, 2013 at 11:07 AM, Vladimir Davydov vdavy...@parallels.com wrote: On 12/18/2013 09:41 PM, Michal Hocko wrote: On Wed 18-12-13 17:16:55, Vladimir Davydov wrote: The

Re: [Devel] [PATCH 4/6] memcg, slab: check and init memcg_cahes under slab_mutex

2013-12-19 Thread Vladimir Davydov
Hi, Christoph We have a problem with memcg-vs-slab interactions. Currently we set the pointer to a new kmem_cache in its parent's memcg_caches array inside memcg_create_kmem_cache() (mm/memcontrol.c): memcg_create_kmem_cache(): new_cachep = cache_from_memcg_idx(cachep, idx); if

[Devel] [PATCH 4/6] memcg, slab: check and init memcg_cahes under slab_mutex

2013-12-18 Thread Vladimir Davydov
The memcg_params::memcg_caches array can be updated concurrently from memcg_update_cache_size() and memcg_create_kmem_cache(). Although both of these functions take the slab_mutex during their operation, the latter checks if memcg's cache has already been allocated w/o taking the mutex. This can

Re: [Devel] [PATCH 4/6] memcg, slab: check and init memcg_cahes under slab_mutex

2013-12-18 Thread Michal Hocko
On Wed 18-12-13 17:16:55, Vladimir Davydov wrote: The memcg_params::memcg_caches array can be updated concurrently from memcg_update_cache_size() and memcg_create_kmem_cache(). Although both of these functions take the slab_mutex during their operation, the latter checks if memcg's cache has

Re: [Devel] [PATCH 4/6] memcg, slab: check and init memcg_cahes under slab_mutex

2013-12-18 Thread Vladimir Davydov
On 12/18/2013 09:41 PM, Michal Hocko wrote: On Wed 18-12-13 17:16:55, Vladimir Davydov wrote: The memcg_params::memcg_caches array can be updated concurrently from memcg_update_cache_size() and memcg_create_kmem_cache(). Although both of these functions take the slab_mutex during their