linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Re: [patch 14/22] memcg: fix direct softlimit reclaim to be called in limit path
  2011-06-28  8:08 ` [patch 14/22] memcg: fix direct softlimit reclaim to be called in limit path Michal Hocko
@ 2011-06-28  8:06   ` KAMEZAWA Hiroyuki
  2011-06-28  8:53     ` Michal Hocko
  0 siblings, 1 reply; 3+ messages in thread
From: KAMEZAWA Hiroyuki @ 2011-06-28  8:06 UTC (permalink / raw)
  To: Michal Hocko; +Cc: Andrew Morton, torvalds, nishimura, yinghan, linux-mm, LKML

On Tue, 28 Jun 2011 10:08:47 +0200
Michal Hocko <mhocko@suse.cz> wrote:

> I am sorry, that I am answering that late but I didn't get to this
> sooner.
> 
> On Mon 27-06-11 16:18:12, Andrew Morton wrote:
> > From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> > 
> > commit d149e3b ("memcg: add the soft_limit reclaim in global direct
> > reclaim") adds a softlimit hook to shrink_zones().  By this, soft limit is
> > called as
> > 
> >    try_to_free_pages()
> >        do_try_to_free_pages()
> >            shrink_zones()
> >                mem_cgroup_soft_limit_reclaim()
> > 
> > Then, direct reclaim is memcg softlimit hint aware, now.
> > 
> > But, the memory cgroup's "limit" path can call softlimit shrinker.
> > 
> >    try_to_free_mem_cgroup_pages()
> >        do_try_to_free_pages()
> >            shrink_zones()
> >                mem_cgroup_soft_limit_reclaim()
> > 
> > This will cause a global reclaim when a memcg hits limit.
> 
> Sorry, I do not get it. How does it cause the global reclaim? Did you
> mean soft reclaim?
> 

yes. soft reclaim does global reclaim (in some means). 

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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch 14/22] memcg: fix direct softlimit reclaim to be called in limit path
       [not found] <201106272318.p5RNICJW001465@imap1.linux-foundation.org>
@ 2011-06-28  8:08 ` Michal Hocko
  2011-06-28  8:06   ` KAMEZAWA Hiroyuki
  0 siblings, 1 reply; 3+ messages in thread
From: Michal Hocko @ 2011-06-28  8:08 UTC (permalink / raw)
  To: KAMEZAWA Hiroyuki
  Cc: Andrew Morton, torvalds, nishimura, yinghan, linux-mm, LKML

I am sorry, that I am answering that late but I didn't get to this
sooner.

On Mon 27-06-11 16:18:12, Andrew Morton wrote:
> From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> 
> commit d149e3b ("memcg: add the soft_limit reclaim in global direct
> reclaim") adds a softlimit hook to shrink_zones().  By this, soft limit is
> called as
> 
>    try_to_free_pages()
>        do_try_to_free_pages()
>            shrink_zones()
>                mem_cgroup_soft_limit_reclaim()
> 
> Then, direct reclaim is memcg softlimit hint aware, now.
> 
> But, the memory cgroup's "limit" path can call softlimit shrinker.
> 
>    try_to_free_mem_cgroup_pages()
>        do_try_to_free_pages()
>            shrink_zones()
>                mem_cgroup_soft_limit_reclaim()
> 
> This will cause a global reclaim when a memcg hits limit.

Sorry, I do not get it. How does it cause the global reclaim? Did you
mean soft reclaim?

> 
> This is bug. soft_limit_reclaim() should be called when
> scanning_global_lru(sc) == true.

Agreed

> 
> And the commit adds a variable "total_scanned" for counting softlimit
> scanned pages....it's not "total".  This patch removes the variable and
> update sc->nr_scanned instead of it. This will affect shrink_slab()'s
> scan condition but, global LRU is scanned by softlimit and I think this
> change makes sense.

Yes, the previous semantic was really confusing (part of the scanned
accounting is returned by shrink_zones and the other part in sc). This
could be ideally a separate change because it fixes a different bug
(softlimit is not considered for slab srhinking)

> 
> TODO: avoid too much scanning of a zone when softlimit did enough work.
> 
> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
> Cc: Ying Han <yinghan@google.com>
> Cc: Michal Hocko <mhocko@suse.cz>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Just in case it is not late yet.
Reviewed-by: Michal Hocko <mhocko@suse.cz>

-- 
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch 14/22] memcg: fix direct softlimit reclaim to be called in limit path
  2011-06-28  8:06   ` KAMEZAWA Hiroyuki
@ 2011-06-28  8:53     ` Michal Hocko
  0 siblings, 0 replies; 3+ messages in thread
From: Michal Hocko @ 2011-06-28  8:53 UTC (permalink / raw)
  To: KAMEZAWA Hiroyuki
  Cc: Andrew Morton, torvalds, nishimura, yinghan, linux-mm, LKML

On Tue 28-06-11 17:06:49, KAMEZAWA Hiroyuki wrote:
> On Tue, 28 Jun 2011 10:08:47 +0200
> Michal Hocko <mhocko@suse.cz> wrote:
> 
> > I am sorry, that I am answering that late but I didn't get to this
> > sooner.
> > 
> > On Mon 27-06-11 16:18:12, Andrew Morton wrote:
> > > From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> > > 
> > > commit d149e3b ("memcg: add the soft_limit reclaim in global direct
> > > reclaim") adds a softlimit hook to shrink_zones().  By this, soft limit is
> > > called as
> > > 
> > >    try_to_free_pages()
> > >        do_try_to_free_pages()
> > >            shrink_zones()
> > >                mem_cgroup_soft_limit_reclaim()
> > > 
> > > Then, direct reclaim is memcg softlimit hint aware, now.
> > > 
> > > But, the memory cgroup's "limit" path can call softlimit shrinker.
> > > 
> > >    try_to_free_mem_cgroup_pages()
> > >        do_try_to_free_pages()
> > >            shrink_zones()
> > >                mem_cgroup_soft_limit_reclaim()
> > > 
> > > This will cause a global reclaim when a memcg hits limit.
> > 
> > Sorry, I do not get it. How does it cause the global reclaim? Did you
> > mean soft reclaim?
> > 
> 
> yes. soft reclaim does global reclaim (in some means). 

But calling it global reclaim is rather confusing because in both paths
we have sc.mem_cgroup set to non-NULL which is evaluated as
!scanning_global_lru(sc). Anyway, this is not that important, I just
wanted to be sure what you meant by that comment.

-- 
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-06-28  8:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <201106272318.p5RNICJW001465@imap1.linux-foundation.org>
2011-06-28  8:08 ` [patch 14/22] memcg: fix direct softlimit reclaim to be called in limit path Michal Hocko
2011-06-28  8:06   ` KAMEZAWA Hiroyuki
2011-06-28  8:53     ` Michal Hocko

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