11 Jul 2012 15:24
[PATCH RFC] mm/memcg: calculate max hierarchy limit number instead of min
Wanpeng Li <liwp.linux <at> gmail.com>
2012-07-11 13:24:41 GMT
2012-07-11 13:24:41 GMT
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)
Regards,
Wanpeng Li
>Thanks,
>-Kame
>
>
>> ---
>> mm/memcontrol.c | 14 +++++++-------
RSS Feed