* [PATCH RFC] mm/memcg: calculate max hierarchy limit number instead of min [not found] <a> @ 2012-07-11 13:24 ` Wanpeng Li 2012-07-11 13:47 ` Michal Hocko 2012-07-19 6:07 ` Kamezawa Hiroyuki 0 siblings, 2 replies; 6+ messages in thread From: Wanpeng Li @ 2012-07-11 13:24 UTC (permalink / raw) To: linux-mm Cc: Johannes Weiner, Michal Hocko, KAMEZAWA Hiroyuki, Andrew Morton, cgroups, linux-kernel, Wanpeng Li From: Wanpeng Li <liwp@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@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 @@ -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) -- 1.7.5.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH RFC] mm/memcg: calculate max hierarchy limit number instead of min 2012-07-11 13:24 ` [PATCH RFC] mm/memcg: calculate max hierarchy limit number instead of min Wanpeng Li @ 2012-07-11 13:47 ` Michal Hocko [not found] ` <20120711134757.GC4820-VqjxzfR4DlwKmadIfiO5sKVXKuFTiq87@public.gmane.org> 2012-07-19 6:07 ` Kamezawa Hiroyuki 1 sibling, 1 reply; 6+ messages in thread From: Michal Hocko @ 2012-07-11 13:47 UTC (permalink / raw) To: Wanpeng Li Cc: linux-mm, Johannes Weiner, KAMEZAWA Hiroyuki, Andrew Morton, cgroups, linux-kernel On Wed 11-07-12 21:24:41, Wanpeng Li wrote: > From: Wanpeng Li <liwp@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@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 > @@ -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) > -- > 1.7.5.4 > -- Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <20120711134757.GC4820-VqjxzfR4DlwKmadIfiO5sKVXKuFTiq87@public.gmane.org>]
* Re: [PATCH RFC] mm/memcg: calculate max hierarchy limit number instead of min [not found] ` <20120711134757.GC4820-VqjxzfR4DlwKmadIfiO5sKVXKuFTiq87@public.gmane.org> @ 2012-07-12 9:32 ` Wanpeng Li 2012-07-12 10:18 ` Michal Hocko 0 siblings, 1 reply; 6+ messages in thread From: Wanpeng Li @ 2012-07-12 9:32 UTC (permalink / raw) To: Michal Hocko Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Johannes Weiner, KAMEZAWA Hiroyuki, Andrew Morton, cgroups-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Wanpeng Li 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-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> >> >> 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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> --- >> 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) >> -- >> 1.7.5.4 >> > >-- >Michal Hocko >SUSE Labs >SUSE LINUX s.r.o. >Lihovarska 1060/12 >190 00 Praha 9 >Czech Republic ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH RFC] mm/memcg: calculate max hierarchy limit number instead of min 2012-07-12 9:32 ` Wanpeng Li @ 2012-07-12 10:18 ` Michal Hocko 0 siblings, 0 replies; 6+ messages in thread From: Michal Hocko @ 2012-07-12 10:18 UTC (permalink / raw) To: Wanpeng Li Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Johannes Weiner, KAMEZAWA Hiroyuki, Andrew Morton, cgroups-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA 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-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> > >> > >> 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? > > > >> Signed-off-by: Wanpeng Li <liwp.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > >> --- > >> 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) > >> -- > >> 1.7.5.4 > >> > > > >-- > >Michal Hocko > >SUSE Labs > >SUSE LINUX s.r.o. > >Lihovarska 1060/12 > >190 00 Praha 9 > >Czech Republic -- Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH RFC] mm/memcg: calculate max hierarchy limit number instead of min 2012-07-11 13:24 ` [PATCH RFC] mm/memcg: calculate max hierarchy limit number instead of min Wanpeng Li 2012-07-11 13:47 ` Michal Hocko @ 2012-07-19 6:07 ` Kamezawa Hiroyuki [not found] ` <5007A418.10801-+CUm20s59erQFUHtdCDX3A@public.gmane.org> 1 sibling, 1 reply; 6+ messages in thread From: Kamezawa Hiroyuki @ 2012-07-19 6:07 UTC (permalink / raw) To: Wanpeng Li Cc: linux-mm, Johannes Weiner, Michal Hocko, Andrew Morton, cgroups, linux-kernel (2012/07/11 22:24), Wanpeng Li wrote: > From: Wanpeng Li <liwp@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@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 > @@ -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@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <5007A418.10801-+CUm20s59erQFUHtdCDX3A@public.gmane.org>]
* Re: [PATCH RFC] mm/memcg: calculate max hierarchy limit number instead of min [not found] ` <5007A418.10801-+CUm20s59erQFUHtdCDX3A@public.gmane.org> @ 2012-07-19 6:30 ` Wanpeng Li 0 siblings, 0 replies; 6+ messages in thread From: Wanpeng Li @ 2012-07-19 6:30 UTC (permalink / raw) To: Kamezawa Hiroyuki Cc: Johannes Weiner, Michal Hocko, Andrew Morton, cgroups-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-mm-Bw31MaZKKs3YtjvyW6yDsg 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-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> >> >> 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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > >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-Bw31MaZKKs0EbZ0PF+XxCw@public.gmane.org For more info on Linux MM, >see: http://www.linux-mm.org/ . >Don't email: <a href=mailto:"dont-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org"> email-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org </a> ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-07-19 6:30 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <a>
2012-07-11 13:24 ` [PATCH RFC] mm/memcg: calculate max hierarchy limit number instead of min Wanpeng Li
2012-07-11 13:47 ` Michal Hocko
[not found] ` <20120711134757.GC4820-VqjxzfR4DlwKmadIfiO5sKVXKuFTiq87@public.gmane.org>
2012-07-12 9:32 ` Wanpeng Li
2012-07-12 10:18 ` Michal Hocko
2012-07-19 6:07 ` Kamezawa Hiroyuki
[not found] ` <5007A418.10801-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2012-07-19 6:30 ` Wanpeng Li
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).