All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] memcg: correct return value at mem_cgroup reclaim
@ 2009-12-06 10:16 Liu bo
  2009-12-06 13:30 ` Daisuke Nishimura
  0 siblings, 1 reply; 6+ messages in thread
From: Liu bo @ 2009-12-06 10:16 UTC (permalink / raw)
  To: akpm; +Cc: kamezawa.hiroyu, linux-mm


In order to indicate reclaim has succeeded, mem_cgroup_hierarchical_reclaim() used to return 1.
Now the return value is without indicating whether reclaim has successded usage, so just return the total reclaimed pages don't plus 1.
 
Signed-off-by: Liu Bo <bo-liu@hotmail.com>
---
 
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 14593f5..51b6b3c 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -737,7 +737,7 @@ static int mem_cgroup_hierarchical_reclaim(struct mem_cgroup *root_mem,
   css_put(&victim->css);
   total += ret;
   if (mem_cgroup_check_under_limit(root_mem))
-   return 1 + total;
+   return total;
  }
  return total;
 } 		 	   		  
_________________________________________________________________
Windows Live: Keep your friends up to date with what you do online.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_1:092010

--
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] memcg: correct return value at mem_cgroup reclaim
  2009-12-06 10:16 [PATCH] memcg: correct return value at mem_cgroup reclaim Liu bo
@ 2009-12-06 13:30 ` Daisuke Nishimura
       [not found]   ` <COL115-W12ECCA5335D3BFBB60D5829F900@phx.gbl>
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Daisuke Nishimura @ 2009-12-06 13:30 UTC (permalink / raw)
  To: Liu bo; +Cc: akpm, kamezawa.hiroyu, linux-mm, balbir, nishimura

hi,

On Sun, 6 Dec 2009 18:16:14 +0800
Liu bo <bo-liu@hotmail.com> wrote:

> 
> In order to indicate reclaim has succeeded, mem_cgroup_hierarchical_reclaim() used to return 1.
> Now the return value is without indicating whether reclaim has successded usage, so just return the total reclaimed pages don't plus 1.
>  
> Signed-off-by: Liu Bo <bo-liu@hotmail.com>
> ---
>  
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 14593f5..51b6b3c 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -737,7 +737,7 @@ static int mem_cgroup_hierarchical_reclaim(struct mem_cgroup *root_mem,
>    css_put(&victim->css);
>    total += ret;
>    if (mem_cgroup_check_under_limit(root_mem))
> -   return 1 + total;
> +   return total;
>   }
>   return total;
>  } 		 	   		  
What's the benefit of this change ?
I can't find any benefit to bother changing current behavior.

P.S.
You should run ./scripts/checkpatch.pl before sending your patch,
and refer to Documentation/email-clients.txt and check your email client setting.


Regards,
Daisuke Nishimura.

--
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

* Re: [PATCH] memcg: correct return value at mem_cgroup reclaim
       [not found]   ` <COL115-W12ECCA5335D3BFBB60D5829F900@phx.gbl>
@ 2009-12-07  2:23     ` Bob Liu
  0 siblings, 0 replies; 6+ messages in thread
From: Bob Liu @ 2009-12-07  2:23 UTC (permalink / raw)
  To: d-nishimura; +Cc: akpm, kamezawa.hiroyu, linux-mm, balbir, lliubbo

On Sun, 6 Dec 2009 22:30:46 +0900
Daisuke Nishimura wrote:
>
> hi,
>
> On Sun, 6 Dec 2009 18:16:14 +0800
> Liu bo wrote:
>
>>
>> In order to indicate reclaim has succeeded, mem_cgroup_hierarchical_reclaim() used to return 1.
>> Now the return value is without indicating whether reclaim has successded usage, so just return the total reclaimed pages don't plus 1.
>>
>> Signed-off-by: Liu Bo
>> ---
>>
>> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
>> index 14593f5..51b6b3c 100644
>> --- a/mm/memcontrol.c
>> +++ b/mm/memcontrol.c
>> @@ -737,7 +737,7 @@ static int mem_cgroup_hierarchical_reclaim(struct mem_cgroup *root_mem,
>> css_put(&victim->css);
>> total += ret;
>> if (mem_cgroup_check_under_limit(root_mem))
>> - return 1 + total;
>> + return total;
>> }
>> return total;
>> }
> What's the benefit of this change ?
> I can't find any benefit to bother changing current behavior.
>
en..I think there is just a little unnormal logic. The function
recliam total pages,
but return 1 + total to the caller. I am unclear why do this,it have
no benefit too.

Anyway,yes,there is no benifit of this change in current code.
Please just ignore this patch.

> P.S.
> You should run ./scripts/checkpatch.pl before sending your patch,
> and refer to Documentation/email-clients.txt and check your email client setting.
>

Sorry, I registered a gmail and hoping it will be ok! :-)
Thanks!
-- 
Regards,
-Bob Liu

--
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

* Re: [PATCH] memcg: correct return value at mem_cgroup reclaim
  2009-12-06 13:30 ` Daisuke Nishimura
       [not found]   ` <COL115-W12ECCA5335D3BFBB60D5829F900@phx.gbl>
@ 2009-12-07  7:47   ` Balbir Singh
  2009-12-09  0:28   ` KAMEZAWA Hiroyuki
  2 siblings, 0 replies; 6+ messages in thread
From: Balbir Singh @ 2009-12-07  7:47 UTC (permalink / raw)
  To: nishimura; +Cc: Liu bo, akpm, kamezawa.hiroyu, linux-mm

* Daisuke Nishimura <d-nishimura@mtf.biglobe.ne.jp> [2009-12-06 22:30:46]:

> hi,
> 
> On Sun, 6 Dec 2009 18:16:14 +0800
> Liu bo <bo-liu@hotmail.com> wrote:
> 
> > 
> > In order to indicate reclaim has succeeded, mem_cgroup_hierarchical_reclaim() used to return 1.
> > Now the return value is without indicating whether reclaim has successded usage, so just return the total reclaimed pages don't plus 1.
> >  
> > Signed-off-by: Liu Bo <bo-liu@hotmail.com>
> > ---
> >  
> > diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> > index 14593f5..51b6b3c 100644
> > --- a/mm/memcontrol.c
> > +++ b/mm/memcontrol.c
> > @@ -737,7 +737,7 @@ static int mem_cgroup_hierarchical_reclaim(struct mem_cgroup *root_mem,
> >    css_put(&victim->css);
> >    total += ret;
> >    if (mem_cgroup_check_under_limit(root_mem))
> > -   return 1 + total;
> > +   return total;
> >   }
> >   return total;
> >  } 		 	   		  
> What's the benefit of this change ?
> I can't find any benefit to bother changing current behavior.
>

I agree, I added the "1 +" for a reason, if the new group is under its
limit magically without us having to reclaim anything (task exits or
memory freed), I don't want to look at total and see we reclaimed
nothing and take action.
 
> P.S.
> You should run ./scripts/checkpatch.pl before sending your patch,
> and refer to Documentation/email-clients.txt and check your email client setting.
>

Yes, the tabbing and spaces seem to be broken 

-- 
	Balbir

--
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

* Re: [PATCH] memcg: correct return value at mem_cgroup reclaim
  2009-12-06 13:30 ` Daisuke Nishimura
       [not found]   ` <COL115-W12ECCA5335D3BFBB60D5829F900@phx.gbl>
  2009-12-07  7:47   ` Balbir Singh
@ 2009-12-09  0:28   ` KAMEZAWA Hiroyuki
  2009-12-09  6:22     ` Balbir Singh
  2 siblings, 1 reply; 6+ messages in thread
From: KAMEZAWA Hiroyuki @ 2009-12-09  0:28 UTC (permalink / raw)
  To: nishimura; +Cc: Daisuke Nishimura, Liu bo, akpm, linux-mm, balbir

On Sun, 6 Dec 2009 22:30:46 +0900
Daisuke Nishimura <d-nishimura@mtf.biglobe.ne.jp> wrote:

> hi,
> 
> On Sun, 6 Dec 2009 18:16:14 +0800
> Liu bo <bo-liu@hotmail.com> wrote:
> 
> > 
> > In order to indicate reclaim has succeeded, mem_cgroup_hierarchical_reclaim() used to return 1.
> > Now the return value is without indicating whether reclaim has successded usage, so just return the total reclaimed pages don't plus 1.
> >  
> > Signed-off-by: Liu Bo <bo-liu@hotmail.com>
> > ---
> >  
> > diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> > index 14593f5..51b6b3c 100644
> > --- a/mm/memcontrol.c
> > +++ b/mm/memcontrol.c
> > @@ -737,7 +737,7 @@ static int mem_cgroup_hierarchical_reclaim(struct mem_cgroup *root_mem,
> >    css_put(&victim->css);
> >    total += ret;
> >    if (mem_cgroup_check_under_limit(root_mem))
> > -   return 1 + total;
> > +   return total;
> >   }
> >   return total;
> >  } 		 	   		  
> What's the benefit of this change ?
> I can't find any benefit to bother changing current behavior.
> 

please leave this as it is or adds comment.
This "1 + total" means "returning success, not 0" even if this has no behavior changes.

Thanks,
-Kame

--
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

* Re: [PATCH] memcg: correct return value at mem_cgroup reclaim
  2009-12-09  0:28   ` KAMEZAWA Hiroyuki
@ 2009-12-09  6:22     ` Balbir Singh
  0 siblings, 0 replies; 6+ messages in thread
From: Balbir Singh @ 2009-12-09  6:22 UTC (permalink / raw)
  To: KAMEZAWA Hiroyuki; +Cc: nishimura, Daisuke Nishimura, Liu bo, akpm, linux-mm

* KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> [2009-12-09 09:28:42]:

> On Sun, 6 Dec 2009 22:30:46 +0900
> Daisuke Nishimura <d-nishimura@mtf.biglobe.ne.jp> wrote:
> 
> > hi,
> > 
> > On Sun, 6 Dec 2009 18:16:14 +0800
> > Liu bo <bo-liu@hotmail.com> wrote:
> > 
> > > 
> > > In order to indicate reclaim has succeeded, mem_cgroup_hierarchical_reclaim() used to return 1.
> > > Now the return value is without indicating whether reclaim has successded usage, so just return the total reclaimed pages don't plus 1.
> > >  
> > > Signed-off-by: Liu Bo <bo-liu@hotmail.com>
> > > ---
> > >  
> > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> > > index 14593f5..51b6b3c 100644
> > > --- a/mm/memcontrol.c
> > > +++ b/mm/memcontrol.c
> > > @@ -737,7 +737,7 @@ static int mem_cgroup_hierarchical_reclaim(struct mem_cgroup *root_mem,
> > >    css_put(&victim->css);
> > >    total += ret;
> > >    if (mem_cgroup_check_under_limit(root_mem))
> > > -   return 1 + total;
> > > +   return total;
> > >   }
> > >   return total;
> > >  } 		 	   		  
> > What's the benefit of this change ?
> > I can't find any benefit to bother changing current behavior.
> > 
> 
> please leave this as it is or adds comment.
> This "1 + total" means "returning success, not 0" even if this has no behavior changes.
>

I prefer adding the comments, I will get to it if Liu does not.

-- 
	Balbir

--
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

end of thread, other threads:[~2009-12-09  6:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-06 10:16 [PATCH] memcg: correct return value at mem_cgroup reclaim Liu bo
2009-12-06 13:30 ` Daisuke Nishimura
     [not found]   ` <COL115-W12ECCA5335D3BFBB60D5829F900@phx.gbl>
2009-12-07  2:23     ` Bob Liu
2009-12-07  7:47   ` Balbir Singh
2009-12-09  0:28   ` KAMEZAWA Hiroyuki
2009-12-09  6:22     ` Balbir Singh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.