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

2019-04-18 Thread Roman Gushchin
On Thu, Apr 18, 2019 at 01:38:44PM +, Christopher Lameter wrote: > On Wed, 17 Apr 2019, Roman Gushchin wrote: > > > static __always_inline int memcg_charge_slab(struct page *page, > > gfp_t gfp, int order, > > s

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

2019-04-18 Thread Roman Gushchin
On Thu, Apr 18, 2019 at 07:05:24AM -0700, Shakeel Butt wrote: > On Wed, Apr 17, 2019 at 8:07 PM Roman Gushchin wrote: > > > > On Wed, Apr 17, 2019 at 06:55:12PM -0700, Shakeel Butt wrote: > > > On Wed, Apr 17, 2019 at 5:39 PM Roman Gushchin wrote: > > > > > > > > On Wed, Apr 17, 2019 at 04:41:01P

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

2019-04-18 Thread Roman Gushchin
On Thu, Apr 18, 2019 at 01:34:52PM +, Christopher Lameter wrote: > On Wed, 17 Apr 2019, Roman Gushchin wrote: > > > Let's make every page to hold a reference to the kmem_cache (we > > already have a stable pointer), and make kmem_caches to hold a single > > reference to the memory cgroup. > >

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

2019-04-18 Thread Shakeel Butt
On Wed, Apr 17, 2019 at 8:07 PM Roman Gushchin wrote: > > On Wed, Apr 17, 2019 at 06:55:12PM -0700, Shakeel Butt wrote: > > On Wed, Apr 17, 2019 at 5:39 PM Roman Gushchin wrote: > > > > > > On Wed, Apr 17, 2019 at 04:41:01PM -0700, Shakeel Butt wrote: > > > > On Wed, Apr 17, 2019 at 2:55 PM Roman

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

2019-04-18 Thread Christopher Lameter
On Wed, 17 Apr 2019, Roman Gushchin wrote: > static __always_inline int memcg_charge_slab(struct page *page, >gfp_t gfp, int order, >struct kmem_cache *s) > { > - if (is_root_cache(s)) > + int idx = (

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

2019-04-18 Thread Christopher Lameter
On Wed, 17 Apr 2019, Roman Gushchin wrote: > Let's make every page to hold a reference to the kmem_cache (we > already have a stable pointer), and make kmem_caches to hold a single > reference to the memory cgroup. Ok you are freeing one word in the page struct that can be used for other purposes

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

2019-04-17 Thread Roman Gushchin
On Wed, Apr 17, 2019 at 06:55:12PM -0700, Shakeel Butt wrote: > On Wed, Apr 17, 2019 at 5:39 PM Roman Gushchin wrote: > > > > On Wed, Apr 17, 2019 at 04:41:01PM -0700, Shakeel Butt wrote: > > > On Wed, Apr 17, 2019 at 2:55 PM Roman Gushchin wrote: > > > > > > > > This commit makes several importa

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

2019-04-17 Thread Shakeel Butt
On Wed, Apr 17, 2019 at 5:39 PM Roman Gushchin wrote: > > On Wed, Apr 17, 2019 at 04:41:01PM -0700, Shakeel Butt wrote: > > On Wed, Apr 17, 2019 at 2:55 PM Roman Gushchin wrote: > > > > > > This commit makes several important changes in the lifecycle > > > of a non-root kmem_cache, which also aff

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

2019-04-17 Thread Roman Gushchin
On Wed, Apr 17, 2019 at 04:41:01PM -0700, Shakeel Butt wrote: > On Wed, Apr 17, 2019 at 2:55 PM 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 ch

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

2019-04-17 Thread Shakeel Butt
On Wed, Apr 17, 2019 at 2:55 PM 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 the memory cgroup and ho

[PATCH 4/5] mm: rework non-root kmem_cache lifecycle management

2019-04-17 Thread Roman Gushchin
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 the memory cgroup and holds a reference to it. Kmem_caches are held by the cgroup. On offlin