Re: [PATCH v13 11/16] mm: list_lru: add per-memcg lists

2013-12-14 Thread Vladimir Davydov
On 12/13/2013 12:24 AM, Vladimir Davydov wrote: > On 12/12/2013 01:50 PM, Vladimir Davydov wrote: >> +int memcg_list_lru_init(struct list_lru *lru) >> +{ >> +int err = 0; >> +int i; >> +struct mem_cgroup *memcg; >> + >> +lru->memcg =

Re: [PATCH v13 11/16] mm: list_lru: add per-memcg lists

2013-12-14 Thread Vladimir Davydov
On 12/13/2013 12:24 AM, Vladimir Davydov wrote: On 12/12/2013 01:50 PM, Vladimir Davydov wrote: +int memcg_list_lru_init(struct list_lru *lru) +{ +int err = 0; +int i; +struct mem_cgroup *memcg; + +lru-memcg = NULL; +lru-memcg_old = NULL; + +

Re: [PATCH v13 11/16] mm: list_lru: add per-memcg lists

2013-12-12 Thread Glauber Costa
> OK, as far as I can tell, this is introducing a per-node, per-memcg > LRU lists. Is that correct? > > If so, then that is not what Glauber and I originally intended for > memcg LRUs. per-node LRUs are expensive in terms of memory and cross > multiplying them by the number of memcgs in a system

Re: [PATCH v13 11/16] mm: list_lru: add per-memcg lists

2013-12-12 Thread Vladimir Davydov
On 12/12/2013 01:50 PM, Vladimir Davydov wrote: > +int memcg_list_lru_init(struct list_lru *lru) > +{ > + int err = 0; > + int i; > + struct mem_cgroup *memcg; > + > + lru->memcg = NULL; > + lru->memcg_old = NULL; > + > + mutex_lock(_create_mutex); > +

Re: [PATCH v13 11/16] mm: list_lru: add per-memcg lists

2013-12-12 Thread Vladimir Davydov
On 12/12/2013 05:40 AM, Dave Chinner wrote: +int list_lru_grow_memcg(struct list_lru *lru, size_t new_array_size) +{ + int i; + struct list_lru_one **memcg_lrus; + + memcg_lrus = kcalloc(new_array_size, sizeof(*memcg_lrus), GFP_KERNEL); + if (!memcg_lrus)

Re: [PATCH v13 11/16] mm: list_lru: add per-memcg lists

2013-12-12 Thread Vladimir Davydov
On 12/12/2013 05:40 AM, Dave Chinner wrote: +int list_lru_grow_memcg(struct list_lru *lru, size_t new_array_size) +{ + int i; + struct list_lru_one **memcg_lrus; + + memcg_lrus = kcalloc(new_array_size, sizeof(*memcg_lrus), GFP_KERNEL); + if (!memcg_lrus) + return -ENOMEM; +

Re: [PATCH v13 11/16] mm: list_lru: add per-memcg lists

2013-12-12 Thread Vladimir Davydov
On 12/12/2013 01:50 PM, Vladimir Davydov wrote: +int memcg_list_lru_init(struct list_lru *lru) +{ + int err = 0; + int i; + struct mem_cgroup *memcg; + + lru-memcg = NULL; + lru-memcg_old = NULL; + + mutex_lock(memcg_create_mutex); + if (!memcg_kmem_enabled()) + goto

Re: [PATCH v13 11/16] mm: list_lru: add per-memcg lists

2013-12-12 Thread Glauber Costa
OK, as far as I can tell, this is introducing a per-node, per-memcg LRU lists. Is that correct? If so, then that is not what Glauber and I originally intended for memcg LRUs. per-node LRUs are expensive in terms of memory and cross multiplying them by the number of memcgs in a system was not

Re: [PATCH v13 11/16] mm: list_lru: add per-memcg lists

2013-12-11 Thread Dave Chinner
On Tue, Dec 10, 2013 at 02:05:47PM +0400, Vladimir Davydov wrote: > Hi, David > > First of all, let me thank you for such a thorough review. It is really > helpful. As usual, I can't help agreeing with most of your comments, but > there are a couple of things I'd like to clarify. Please, see

Re: [PATCH v13 11/16] mm: list_lru: add per-memcg lists

2013-12-11 Thread Dave Chinner
On Tue, Dec 10, 2013 at 02:05:47PM +0400, Vladimir Davydov wrote: Hi, David First of all, let me thank you for such a thorough review. It is really helpful. As usual, I can't help agreeing with most of your comments, but there are a couple of things I'd like to clarify. Please, see comments

Re: [PATCH v13 11/16] mm: list_lru: add per-memcg lists

2013-12-10 Thread Vladimir Davydov
Hi, David First of all, let me thank you for such a thorough review. It is really helpful. As usual, I can't help agreeing with most of your comments, but there are a couple of things I'd like to clarify. Please, see comments inline. On 12/10/2013 09:00 AM, Dave Chinner wrote: > On Mon, Dec 09,

Re: [PATCH v13 11/16] mm: list_lru: add per-memcg lists

2013-12-10 Thread Vladimir Davydov
Hi, David First of all, let me thank you for such a thorough review. It is really helpful. As usual, I can't help agreeing with most of your comments, but there are a couple of things I'd like to clarify. Please, see comments inline. On 12/10/2013 09:00 AM, Dave Chinner wrote: On Mon, Dec 09,

Re: [PATCH v13 11/16] mm: list_lru: add per-memcg lists

2013-12-09 Thread Dave Chinner
On Mon, Dec 09, 2013 at 12:05:52PM +0400, Vladimir Davydov wrote: > There are several FS shrinkers, including super_block::s_shrink, that > keep reclaimable objects in the list_lru structure. That said, to turn > them to memcg-aware shrinkers, it is enough to make list_lru per-memcg. > > This

[PATCH v13 11/16] mm: list_lru: add per-memcg lists

2013-12-09 Thread Vladimir Davydov
There are several FS shrinkers, including super_block::s_shrink, that keep reclaimable objects in the list_lru structure. That said, to turn them to memcg-aware shrinkers, it is enough to make list_lru per-memcg. This patch does the trick. It adds an array of LRU lists to the list_lru structure,

[PATCH v13 11/16] mm: list_lru: add per-memcg lists

2013-12-09 Thread Vladimir Davydov
There are several FS shrinkers, including super_block::s_shrink, that keep reclaimable objects in the list_lru structure. That said, to turn them to memcg-aware shrinkers, it is enough to make list_lru per-memcg. This patch does the trick. It adds an array of LRU lists to the list_lru structure,

Re: [PATCH v13 11/16] mm: list_lru: add per-memcg lists

2013-12-09 Thread Dave Chinner
On Mon, Dec 09, 2013 at 12:05:52PM +0400, Vladimir Davydov wrote: There are several FS shrinkers, including super_block::s_shrink, that keep reclaimable objects in the list_lru structure. That said, to turn them to memcg-aware shrinkers, it is enough to make list_lru per-memcg. This patch