Re: [PATCH v5 5/7] mm: rework non-root kmem_cache lifecycle management

2019-05-28 Thread Roman Gushchin
On Tue, May 28, 2019 at 06:03:53PM -0400, Johannes Weiner wrote: > On Tue, May 21, 2019 at 01:07:33PM -0700, Roman Gushchin wrote: > > + arr = rcu_dereference(cachep->memcg_params.memcg_caches); > > + > > + /* > > +* Make sure we will access the up-to-date value. The code updating > > +

Re: [PATCH v5 5/7] mm: rework non-root kmem_cache lifecycle management

2019-05-28 Thread Johannes Weiner
On Tue, May 21, 2019 at 01:07:33PM -0700, Roman Gushchin wrote: > + arr = rcu_dereference(cachep->memcg_params.memcg_caches); > + > + /* > + * Make sure we will access the up-to-date value. The code updating > + * memcg_caches issues a write barrier to match this (see > + *

Re: [PATCH v5 5/7] mm: rework non-root kmem_cache lifecycle management

2019-05-28 Thread Vladimir Davydov
On Tue, May 28, 2019 at 08:08:28PM +0300, Vladimir Davydov wrote: > Hello Roman, > > On Tue, May 21, 2019 at 01:07:33PM -0700, Roman Gushchin wrote: > > This commit makes several important changes in the lifecycle > > of a non-root kmem_cache, which also affect the lifecycle > > of a memory

Re: [PATCH v5 5/7] mm: rework non-root kmem_cache lifecycle management

2019-05-28 Thread Waiman Long
On 5/28/19 1:39 PM, Vladimir Davydov wrote: > On Tue, May 28, 2019 at 01:37:50PM -0400, Waiman Long wrote: >> On 5/28/19 1:08 PM, Vladimir Davydov wrote: static void flush_memcg_workqueue(struct kmem_cache *s) { + /* + * memcg_params.dying is synchronized using slab_mutex

Re: [PATCH v5 5/7] mm: rework non-root kmem_cache lifecycle management

2019-05-28 Thread Vladimir Davydov
On Tue, May 28, 2019 at 01:37:50PM -0400, Waiman Long wrote: > On 5/28/19 1:08 PM, Vladimir Davydov wrote: > >> static void flush_memcg_workqueue(struct kmem_cache *s) > >> { > >> + /* > >> + * memcg_params.dying is synchronized using slab_mutex AND > >> + * memcg_kmem_wq_lock spinlock,

Re: [PATCH v5 5/7] mm: rework non-root kmem_cache lifecycle management

2019-05-28 Thread Vladimir Davydov
Hello Roman, On Tue, May 21, 2019 at 01:07:33PM -0700, Roman Gushchin wrote: > This commit makes several important changes in the lifecycle > of a non-root kmem_cache, which also affect the lifecycle > of a memory cgroup. > > Currently each charged slab page has a page->mem_cgroup pointer > to