* [PATCH v3 3/4] memcg: optimize memcg_get_hierarchical_limit
@ 2012-06-25 8:44 Wanpeng Li
[not found] ` <1340613872-9581-1-git-send-email-liwp.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Wanpeng Li @ 2012-06-25 8:44 UTC (permalink / raw)
To: Michal Hocko
Cc: Johannes Weiner, KAMEZAWA Hiroyuki, Balbir Singh, Andrew Morton,
Eric Dumazet, Mike Frysinger, Arun Sharma,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
cgroups-u79uwXL29TY76Z2rM5mHXA, Wanpeng Li
From: Wanpeng Li <liwp-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Optimize memcg_get_hierarchical_limit to save cpu cycle.
Signed-off-by: Wanpeng Li <liwp.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
mm/memcontrol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 2e81328..4520b57 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3917,9 +3917,9 @@ static void memcg_get_hierarchical_limit(struct mem_cgroup *memcg,
min_limit = res_counter_read_u64(&memcg->res, RES_LIMIT);
min_memsw_limit = res_counter_read_u64(&memcg->memsw, RES_LIMIT);
- cgroup = memcg->css.cgroup;
if (!memcg->use_hierarchy)
goto out;
+ cgroup = memcg->css.cgroup;
while (cgroup->parent) {
cgroup = cgroup->parent;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread[parent not found: <1340613872-9581-1-git-send-email-liwp.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH v3 3/4] memcg: optimize memcg_get_hierarchical_limit [not found] ` <1340613872-9581-1-git-send-email-liwp.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2012-06-25 9:46 ` Michal Hocko 2012-06-25 9:52 ` Kamezawa Hiroyuki 1 sibling, 0 replies; 7+ messages in thread From: Michal Hocko @ 2012-06-25 9:46 UTC (permalink / raw) To: Wanpeng Li Cc: Johannes Weiner, KAMEZAWA Hiroyuki, Balbir Singh, Andrew Morton, Eric Dumazet, Mike Frysinger, Arun Sharma, linux-kernel-u79uwXL29TY76Z2rM5mHXA, cgroups-u79uwXL29TY76Z2rM5mHXA On Mon 25-06-12 16:44:32, Wanpeng Li wrote: > From: Wanpeng Li <liwp-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> > > Optimize memcg_get_hierarchical_limit to save cpu cycle. How did you check that this actually saves some cycles? There are no (compiler) barriers here so it should reordered. > Signed-off-by: Wanpeng Li <liwp.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > --- > mm/memcontrol.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 2e81328..4520b57 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -3917,9 +3917,9 @@ static void memcg_get_hierarchical_limit(struct mem_cgroup *memcg, > > min_limit = res_counter_read_u64(&memcg->res, RES_LIMIT); > min_memsw_limit = res_counter_read_u64(&memcg->memsw, RES_LIMIT); > - cgroup = memcg->css.cgroup; > if (!memcg->use_hierarchy) > goto out; > + cgroup = memcg->css.cgroup; > > while (cgroup->parent) { > cgroup = cgroup->parent; > -- > 1.7.9.5 > -- Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3 3/4] memcg: optimize memcg_get_hierarchical_limit [not found] ` <1340613872-9581-1-git-send-email-liwp.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2012-06-25 9:46 ` Michal Hocko @ 2012-06-25 9:52 ` Kamezawa Hiroyuki [not found] ` <4FE834D9.8070903-+CUm20s59erQFUHtdCDX3A@public.gmane.org> 1 sibling, 1 reply; 7+ messages in thread From: Kamezawa Hiroyuki @ 2012-06-25 9:52 UTC (permalink / raw) To: Wanpeng Li Cc: Michal Hocko, Johannes Weiner, Balbir Singh, Andrew Morton, Eric Dumazet, Mike Frysinger, Arun Sharma, linux-kernel-u79uwXL29TY76Z2rM5mHXA, cgroups-u79uwXL29TY76Z2rM5mHXA (2012/06/25 17:44), Wanpeng Li wrote: > From: Wanpeng Li <liwp-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> > > Optimize memcg_get_hierarchical_limit to save cpu cycle. > > Signed-off-by: Wanpeng Li <liwp.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> I can't understand the benefit of this patch to the real world... So, if you wrote the patch description as "clean up" rather than optimize, ok, I'll agree. Thanks, -Kame > --- > mm/memcontrol.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 2e81328..4520b57 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -3917,9 +3917,9 @@ static void memcg_get_hierarchical_limit(struct mem_cgroup *memcg, > > min_limit = res_counter_read_u64(&memcg->res, RES_LIMIT); > min_memsw_limit = res_counter_read_u64(&memcg->memsw, RES_LIMIT); > - cgroup = memcg->css.cgroup; > if (!memcg->use_hierarchy) > goto out; > + cgroup = memcg->css.cgroup; > > while (cgroup->parent) { > cgroup = cgroup->parent; > ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <4FE834D9.8070903-+CUm20s59erQFUHtdCDX3A@public.gmane.org>]
* Re: [PATCH v3 3/4] memcg: optimize memcg_get_hierarchical_limit [not found] ` <4FE834D9.8070903-+CUm20s59erQFUHtdCDX3A@public.gmane.org> @ 2012-06-25 10:43 ` Wanpeng Li 2012-06-25 11:09 ` Michal Hocko 0 siblings, 1 reply; 7+ messages in thread From: Wanpeng Li @ 2012-06-25 10:43 UTC (permalink / raw) To: Kamezawa Hiroyuki Cc: Michal Hocko, Johannes Weiner, Balbir Singh, Andrew Morton, Eric Dumazet, Mike Frysinger, Arun Sharma, linux-kernel-u79uwXL29TY76Z2rM5mHXA, cgroups-u79uwXL29TY76Z2rM5mHXA, Wanpeng Li On Mon, Jun 25, 2012 at 06:52:25PM +0900, Kamezawa Hiroyuki wrote: >(2012/06/25 17:44), Wanpeng Li wrote: >> From: Wanpeng Li <liwp-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> >> >> Optimize memcg_get_hierarchical_limit to save cpu cycle. >> >> Signed-off-by: Wanpeng Li <liwp.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > >I can't understand the benefit of this patch to the real world... > >So, if you wrote the patch description as "clean up" rather than optimize, >ok, I'll agree. OK, I will change to "Cleanup". Thank you Kame. Best Regards, Wanpeng Li > >Thanks, >-Kame > >> --- >> mm/memcontrol.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/mm/memcontrol.c b/mm/memcontrol.c >> index 2e81328..4520b57 100644 >> --- a/mm/memcontrol.c >> +++ b/mm/memcontrol.c >> @@ -3917,9 +3917,9 @@ static void memcg_get_hierarchical_limit(struct mem_cgroup *memcg, >> >> min_limit = res_counter_read_u64(&memcg->res, RES_LIMIT); >> min_memsw_limit = res_counter_read_u64(&memcg->memsw, RES_LIMIT); >> - cgroup = memcg->css.cgroup; >> if (!memcg->use_hierarchy) >> goto out; >> + cgroup = memcg->css.cgroup; >> >> while (cgroup->parent) { >> cgroup = cgroup->parent; >> > > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3 3/4] memcg: optimize memcg_get_hierarchical_limit 2012-06-25 10:43 ` Wanpeng Li @ 2012-06-25 11:09 ` Michal Hocko [not found] ` <20120625110926.GJ19805-VqjxzfR4DlwKmadIfiO5sKVXKuFTiq87@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Michal Hocko @ 2012-06-25 11:09 UTC (permalink / raw) To: Wanpeng Li Cc: Kamezawa Hiroyuki, Johannes Weiner, Balbir Singh, Andrew Morton, Eric Dumazet, Mike Frysinger, Arun Sharma, linux-kernel-u79uwXL29TY76Z2rM5mHXA, cgroups-u79uwXL29TY76Z2rM5mHXA On Mon 25-06-12 18:43:57, Wanpeng Li wrote: > On Mon, Jun 25, 2012 at 06:52:25PM +0900, Kamezawa Hiroyuki wrote: > >(2012/06/25 17:44), Wanpeng Li wrote: > >> From: Wanpeng Li <liwp-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> > >> > >> Optimize memcg_get_hierarchical_limit to save cpu cycle. > >> > >> Signed-off-by: Wanpeng Li <liwp.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > >I can't understand the benefit of this patch to the real world... > > > >So, if you wrote the patch description as "clean up" rather than optimize, > >ok, I'll agree. > OK, I will change to "Cleanup". Thank you Kame. Does this really clean something up? -- Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <20120625110926.GJ19805-VqjxzfR4DlwKmadIfiO5sKVXKuFTiq87@public.gmane.org>]
* Re: [PATCH v3 3/4] memcg: optimize memcg_get_hierarchical_limit [not found] ` <20120625110926.GJ19805-VqjxzfR4DlwKmadIfiO5sKVXKuFTiq87@public.gmane.org> @ 2012-06-25 11:19 ` Wanpeng Li 2012-06-26 2:45 ` Kamezawa Hiroyuki 1 sibling, 0 replies; 7+ messages in thread From: Wanpeng Li @ 2012-06-25 11:19 UTC (permalink / raw) To: Michal Hocko Cc: Johannes Weiner, KAMEZAWA Hiroyuki, Balbir Singh, Andrew Morton, linux-kernel-u79uwXL29TY76Z2rM5mHXA, cgroups-u79uwXL29TY76Z2rM5mHXA, Wanpeng Li On Mon, Jun 25, 2012 at 01:09:26PM +0200, Michal Hocko wrote: >On Mon 25-06-12 18:43:57, Wanpeng Li wrote: >> On Mon, Jun 25, 2012 at 06:52:25PM +0900, Kamezawa Hiroyuki wrote: >> >(2012/06/25 17:44), Wanpeng Li wrote: >> >> From: Wanpeng Li <liwp-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> >> >> >> >> Optimize memcg_get_hierarchical_limit to save cpu cycle. >> >> >> >> Signed-off-by: Wanpeng Li <liwp.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> > >> >I can't understand the benefit of this patch to the real world... >> > >> >So, if you wrote the patch description as "clean up" rather than optimize, >> >ok, I'll agree. >> OK, I will change to "Cleanup". Thank you Kame. > >Does this really clean something up? OK, just drop it and resend the patch. Hopefully, you can applied! :-) Best Regards, Wanpeng Li >-- >Michal Hocko >SUSE Labs >SUSE LINUX s.r.o. >Lihovarska 1060/12 >190 00 Praha 9 >Czech Republic ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3 3/4] memcg: optimize memcg_get_hierarchical_limit [not found] ` <20120625110926.GJ19805-VqjxzfR4DlwKmadIfiO5sKVXKuFTiq87@public.gmane.org> 2012-06-25 11:19 ` Wanpeng Li @ 2012-06-26 2:45 ` Kamezawa Hiroyuki 1 sibling, 0 replies; 7+ messages in thread From: Kamezawa Hiroyuki @ 2012-06-26 2:45 UTC (permalink / raw) To: Michal Hocko Cc: Wanpeng Li, Johannes Weiner, Balbir Singh, Andrew Morton, Eric Dumazet, Mike Frysinger, Arun Sharma, linux-kernel-u79uwXL29TY76Z2rM5mHXA, cgroups-u79uwXL29TY76Z2rM5mHXA (2012/06/25 20:09), Michal Hocko wrote: > On Mon 25-06-12 18:43:57, Wanpeng Li wrote: >> On Mon, Jun 25, 2012 at 06:52:25PM +0900, Kamezawa Hiroyuki wrote: >>> (2012/06/25 17:44), Wanpeng Li wrote: >>>> From: Wanpeng Li <liwp-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> >>>> >>>> Optimize memcg_get_hierarchical_limit to save cpu cycle. >>>> >>>> Signed-off-by: Wanpeng Li <liwp.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >>> >>> I can't understand the benefit of this patch to the real world... >>> >>> So, if you wrote the patch description as "clean up" rather than optimize, >>> ok, I'll agree. >> OK, I will change to "Cleanup". Thank you Kame. > > Does this really clean something up? > I just thought unused variable is trash even if it disappears after complie. Thanks, -Kame ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-06-26 2:45 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-25 8:44 [PATCH v3 3/4] memcg: optimize memcg_get_hierarchical_limit Wanpeng Li
[not found] ` <1340613872-9581-1-git-send-email-liwp.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-06-25 9:46 ` Michal Hocko
2012-06-25 9:52 ` Kamezawa Hiroyuki
[not found] ` <4FE834D9.8070903-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2012-06-25 10:43 ` Wanpeng Li
2012-06-25 11:09 ` Michal Hocko
[not found] ` <20120625110926.GJ19805-VqjxzfR4DlwKmadIfiO5sKVXKuFTiq87@public.gmane.org>
2012-06-25 11:19 ` Wanpeng Li
2012-06-26 2:45 ` Kamezawa Hiroyuki
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).