linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Daisuke Nishimura <d-nishimura@mtf.biglobe.ne.jp>
To: balbir@linux.vnet.ibm.com
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"hugh@veritas.com" <hugh@veritas.com>,
	d-nishimura@mtf.biglobe.ne.jp, nishimura@mxp.nes.nec.co.jp
Subject: Re: [PATCH] memcg: fix stale swap cache leak v5
Date: Sat, 2 May 2009 11:56:49 +0900	[thread overview]
Message-ID: <20090502115649.027e4a88.d-nishimura@mtf.biglobe.ne.jp> (raw)
In-Reply-To: <20090501183256.GD4686@balbir.in.ibm.com>

> > > Daisuke in the race conditions mentioned is (2) significant? Since the
> > > accounting is already fixed during mem_cgroup_uncharge_page()?
> > > 
> > Do you mean type-2 stale swap caches I described before ?
> > 
> > They doesn't pressure mem.usage nor memsw.usage as you say,
> > but consumes swp_entry(of cource, type-1 has this problem too).
> > As a result, all the swap space can be used up and causes OOM.
> > 
> 
> Good point..
> 
> > I've verified it long ago by:
> > 
> > - make swap space small(50MB).
> > - set mem.limit(32MB).
> > - run some programs(allocate, touch sometimes, exit) enough to
> >   exceed mem.limit repeatedly(I used page01 included in ltp and run
> >   5 instances 8MB per each in cpuset with 4cpus.).
> > - wait for a very long time :) (2,30 hours IIRC)
> >   You can see the usage of swap cache(grep SwapCached /proc/meminfo)
> >   increasing gradually.
> > 
> > 
> > BTW, I'm now testing a attached patch to fix type-2 with setting page-cluster
> > to 0 to aboid type-1, and seeing what happens in the usage of swap cache.
> > (I can't test it in large box though, because my office is closed till May 06.)
> > 
In my small box(i386/2CPU/2GB mem), a similar test shows after 12H
about 600MB leak of swap cache before applying this patch,
while no outstanding leak can be seen after it.

(snip)

> Looking through the patch, I have my doubts
> 
>  shrink_page_list() will catch the page - how? It is not on memcg's
> LRU, so if we have a small cgroup with lots of memory, when the cgroup
> is running out of memory, will this page show up in
> shrink_page_list()?
> 
It's just because the page has not been uncharged yet when shrink_page_list()
is called(,more precicely, when shrink_inactive_list() isolates the page),
so it can be handled in memcg's LRU scanning.


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

  reply	other threads:[~2009-05-02  2:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-30  7:16 KAMEZAWA Hiroyuki
2009-04-30  7:35 ` KAMEZAWA Hiroyuki
2009-04-30  9:04   ` KAMEZAWA Hiroyuki
2009-04-30  9:42     ` Balbir Singh
2009-04-30  9:47       ` KAMEZAWA Hiroyuki
2009-04-30 18:12         ` Balbir Singh
2009-05-01  4:33           ` Daisuke Nishimura
2009-05-01 18:32             ` Balbir Singh
2009-05-02  2:56               ` Daisuke Nishimura [this message]
2009-05-02  3:09                 ` Daisuke Nishimura
2009-05-04 16:38             ` Balbir Singh
2009-05-07  6:59               ` Daisuke Nishimura

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090502115649.027e4a88.d-nishimura@mtf.biglobe.ne.jp \
    --to=d-nishimura@mtf.biglobe.ne.jp \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=hugh@veritas.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nishimura@mxp.nes.nec.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox