Wanpeng Li | 11 Jul 2012 15:24
Picon

[PATCH RFC] mm/memcg: calculate max hierarchy limit number instead of min

From: Wanpeng Li <liwp <at> linux.vnet.ibm.com>

Since hierachical_memory_limit shows "of bytes of memory limit with
regard to hierarchy under which the memory cgroup is", the count should
calculate max hierarchy limit when use_hierarchy in order to show hierarchy
subtree limit. hierachical_memsw_limit is the same case.

Signed-off-by: Wanpeng Li <liwp.linux <at> gmail.com>
---
 mm/memcontrol.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 69a7d45..6392c0a 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
 <at>  <at>  -3929,10 +3929,10  <at>  <at>  static void memcg_get_hierarchical_limit(struct mem_cgroup *memcg,
 		unsigned long long *mem_limit, unsigned long long *memsw_limit)
 {
 	struct cgroup *cgroup;
-	unsigned long long min_limit, min_memsw_limit, tmp;
+	unsigned long long max_limit, max_memsw_limit, tmp;

-	min_limit = res_counter_read_u64(&memcg->res, RES_LIMIT);
-	min_memsw_limit = res_counter_read_u64(&memcg->memsw, RES_LIMIT);
+	max_limit = res_counter_read_u64(&memcg->res, RES_LIMIT);
+	max_memsw_limit = res_counter_read_u64(&memcg->memsw, RES_LIMIT);
 	cgroup = memcg->css.cgroup;
 	if (!memcg->use_hierarchy)
 		goto out;
(Continue reading)

Michal Hocko | 11 Jul 2012 15:47
Picon

Re: [PATCH RFC] mm/memcg: calculate max hierarchy limit number instead of min

On Wed 11-07-12 21:24:41, Wanpeng Li wrote:
> From: Wanpeng Li <liwp <at> linux.vnet.ibm.com>
> 
> Since hierachical_memory_limit shows "of bytes of memory limit with
> regard to hierarchy under which the memory cgroup is", the count should
> calculate max hierarchy limit when use_hierarchy in order to show hierarchy
> subtree limit. hierachical_memsw_limit is the same case.

No the patch is wrong. The hierarchical limit says when we start
reclaiming in the hierarchy and that one is triggered on smallest limit
up the way to the hierarchy root.

What are you trying to accomplish here?

> Signed-off-by: Wanpeng Li <liwp.linux <at> gmail.com>
> ---
>  mm/memcontrol.c |   14 +++++++-------
>  1 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 69a7d45..6392c0a 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
>  <at>  <at>  -3929,10 +3929,10  <at>  <at>  static void memcg_get_hierarchical_limit(struct mem_cgroup *memcg,
>  		unsigned long long *mem_limit, unsigned long long *memsw_limit)
>  {
>  	struct cgroup *cgroup;
> -	unsigned long long min_limit, min_memsw_limit, tmp;
> +	unsigned long long max_limit, max_memsw_limit, tmp;
>  
(Continue reading)

Wanpeng Li | 12 Jul 2012 11:32
Picon

Re: [PATCH RFC] mm/memcg: calculate max hierarchy limit number instead of min

On Wed, Jul 11, 2012 at 03:47:57PM +0200, Michal Hocko wrote:
>On Wed 11-07-12 21:24:41, Wanpeng Li wrote:
>> From: Wanpeng Li <liwp@...>
>> 
>> Since hierachical_memory_limit shows "of bytes of memory limit with
>> regard to hierarchy under which the memory cgroup is", the count should
>> calculate max hierarchy limit when use_hierarchy in order to show hierarchy
>> subtree limit. hierachical_memsw_limit is the same case.
>
>No the patch is wrong. The hierarchical limit says when we start
>reclaiming in the hierarchy and that one is triggered on smallest limit
>up the way to the hierarchy root.

I see function mem_cgroup_hierachy_reclaim is removal, and hierarchical
reclaim is still work? Could you explain me how it works in details, 
thank you for your time Michal.

Thanks & Best Regards,
Wanpeng Li
>
>What are you trying to accomplish here?
>
>> Signed-off-by: Wanpeng Li <liwp.linux@...>
>> ---
>>  mm/memcontrol.c |   14 +++++++-------
>>  1 files changed, 7 insertions(+), 7 deletions(-)
>> 
>> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
>> index 69a7d45..6392c0a 100644
>> --- a/mm/memcontrol.c
(Continue reading)

Michal Hocko | 12 Jul 2012 12:18
Picon

Re: [PATCH RFC] mm/memcg: calculate max hierarchy limit number instead of min

On Thu 12-07-12 17:32:11, Wanpeng Li wrote:
> On Wed, Jul 11, 2012 at 03:47:57PM +0200, Michal Hocko wrote:
> >On Wed 11-07-12 21:24:41, Wanpeng Li wrote:
> >> From: Wanpeng Li <liwp@...>
> >> 
> >> Since hierachical_memory_limit shows "of bytes of memory limit with
> >> regard to hierarchy under which the memory cgroup is", the count should
> >> calculate max hierarchy limit when use_hierarchy in order to show hierarchy
> >> subtree limit. hierachical_memsw_limit is the same case.
> >
> >No the patch is wrong. The hierarchical limit says when we start
> >reclaiming in the hierarchy and that one is triggered on smallest limit
> >up the way to the hierarchy root.
> 
> I see function mem_cgroup_hierachy_reclaim is removal, and hierarchical
> reclaim is still work? 

I am not aware of that.

> Could you explain me how it works in details, thank you for your time
> Michal.

I am not sure I understand what you are interested in. 

> 
> Thanks & Best Regards,
> Wanpeng Li
> >
> >What are you trying to accomplish here?
> >
(Continue reading)

Kamezawa Hiroyuki | 19 Jul 2012 08:07
Favicon

Re: [PATCH RFC] mm/memcg: calculate max hierarchy limit number instead of min

(2012/07/11 22:24), Wanpeng Li wrote:
> From: Wanpeng Li <liwp <at> linux.vnet.ibm.com>
> 
> Since hierachical_memory_limit shows "of bytes of memory limit with
> regard to hierarchy under which the memory cgroup is", the count should
> calculate max hierarchy limit when use_hierarchy in order to show hierarchy
> subtree limit. hierachical_memsw_limit is the same case.
> 
> Signed-off-by: Wanpeng Li <liwp.linux <at> gmail.com>

Hm ? What is the hierarchical limit for 'C' in following tree ?

A  ---  limit=1G 
 \
  B --  limit=500M
   \
    C - unlimtied

Thanks,
-Kame

> ---
>   mm/memcontrol.c |   14 +++++++-------
>   1 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 69a7d45..6392c0a 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
>  <at>  <at>  -3929,10 +3929,10  <at>  <at>  static void memcg_get_hierarchical_limit(struct mem_cgroup *memcg,
(Continue reading)

Wanpeng Li | 19 Jul 2012 08:30
Picon

Re: [PATCH RFC] mm/memcg: calculate max hierarchy limit number instead of min

On Thu, Jul 19, 2012 at 03:07:20PM +0900, Kamezawa Hiroyuki wrote:
>(2012/07/11 22:24), Wanpeng Li wrote:
>> From: Wanpeng Li <liwp@...>
>> 
>> Since hierachical_memory_limit shows "of bytes of memory limit with
>> regard to hierarchy under which the memory cgroup is", the count should
>> calculate max hierarchy limit when use_hierarchy in order to show hierarchy
>> subtree limit. hierachical_memsw_limit is the same case.
>> 
>> Signed-off-by: Wanpeng Li <liwp.linux@...>
>
>Hm ? What is the hierarchical limit for 'C' in following tree ?
>
>A  ---  limit=1G 
> \
>  B --  limit=500M
>   \
>    C - unlimtied
>
Hmm, thank you Kame. :-)

Regards,
Wanpeng Li 

>Thanks,
>-Kame
>
>
>> ---
>>   mm/memcontrol.c |   14 +++++++-------
(Continue reading)


Gmane