[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20120719063051.GA18422@kernel>
Date: Thu, 19 Jul 2012 14:30:52 +0800
From: Wanpeng Li <liwanp@...ux.vnet.ibm.com>
To: Kamezawa Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Cc: Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...e.cz>,
Andrew Morton <akpm@...ux-foundation.org>,
cgroups@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org
Subject: 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@...ux.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@...il.com>
>
>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 +++++++-------
>> 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
>> @@ -3929,10 +3929,10 @@ 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;
>> @@ -3943,13 +3943,13 @@ static void memcg_get_hierarchical_limit(struct mem_cgroup *memcg,
>> if (!memcg->use_hierarchy)
>> break;
>> tmp = res_counter_read_u64(&memcg->res, RES_LIMIT);
>> - min_limit = min(min_limit, tmp);
>> + max_limit = max(max_limit, tmp);
>> tmp = res_counter_read_u64(&memcg->memsw, RES_LIMIT);
>> - min_memsw_limit = min(min_memsw_limit, tmp);
>> + max_memsw_limit = max(max_memsw_limit, tmp);
>> }
>> out:
>> - *mem_limit = min_limit;
>> - *memsw_limit = min_memsw_limit;
>> + *mem_limit = max_limit;
>> + *memsw_limit = max_memsw_limit;
>> }
>>
>> static int mem_cgroup_reset(struct cgroup *cont, unsigned int event)
>>
>
>
>
>--
>To unsubscribe, send a message with 'unsubscribe linux-mm' in
>the body to majordomo@...ck.org. For more info on Linux MM,
>see: http://www.linux-mm.org/ .
>Don't email: <a href=mailto:"dont@...ck.org"> email@...ck.org </a>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists