From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"balbir@linux.vnet.ibm.com" <balbir@linux.vnet.ibm.com>,
"menage@google.com" <menage@google.com>
Subject: Re: [RFC][PATCH 2/6] memcg: handle swap cache
Date: Fri, 7 Nov 2008 18:13:03 +0900 [thread overview]
Message-ID: <20081107181303.7dd232fd.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <20081107175303.1d5c8a29.nishimura@mxp.nes.nec.co.jp>
On Fri, 7 Nov 2008 17:53:03 +0900
Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> wrote:
> On Wed, 5 Nov 2008 17:20:09 +0900, KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:
> > SwapCache support for memory resource controller (memcg)
> >
> > Before mem+swap controller, memcg itself should handle SwapCache in proper way.
> >
> > In current memcg, SwapCache is just leaked and the user can create tons of
> > SwapCache. This is a leak of account and should be handled.
> >
> > SwapCache accounting is done as following.
> >
> > charge (anon)
> > - charged when it's mapped.
> > (because of readahead, charge at add_to_swap_cache() is not sane)
> > uncharge (anon)
> > - uncharged when it's dropped from swapcache and fully unmapped.
> > means it's not uncharged at unmap.
> > Note: delete from swap cache at swap-in is done after rmap information
> > is established.
> > charge (shmem)
> > - charged at swap-in. this prevents charge at add_to_page_cache().
> >
> > uncharge (shmem)
> > - uncharged when it's dropped from swapcache and not on shmem's
> > radix-tree.
> >
> > at migration, check against 'old page' is modified to handle shmem.
> >
> > Comparing to the old version discussed (and caused troubles), we have
> > advantages of
> > - PCG_USED bit.
> > - simple migrating handling.
> >
> > So, situation is much easier than several months ago, maybe.
> >
> > Changelog (v1) -> (v2)
> > - use lock_page() when we handle unlocked SwapCache.
> >
> > Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> >
> I tested this version under swap in/out activity with page migration/rmdir,
> and it worked w/o errors for more than 24 hours.
>
> Reviewed-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
> Tested-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
>
Thank you!
-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>
next prev parent reply other threads:[~2008-11-07 9:13 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-05 8:16 [RFC][PATCH 0/6] memcg updates (05/Nov) KAMEZAWA Hiroyuki
2008-11-05 8:18 ` [RFC][PATCH 1/6] memcg: move all accounts to parent at rmdir() KAMEZAWA Hiroyuki
2008-11-05 8:20 ` [RFC][PATCH 2/6] memcg: handle swap cache KAMEZAWA Hiroyuki
2008-11-07 8:53 ` Daisuke Nishimura
2008-11-07 9:13 ` KAMEZAWA Hiroyuki [this message]
2008-11-05 8:20 ` [RFC][PATCH 3/6] memcg : mem+swap controller kconfig KAMEZAWA Hiroyuki
2008-11-06 11:07 ` Daisuke Nishimura
2008-11-05 8:21 ` [RFC][PATCH 4/6] memcg : swap cgroup KAMEZAWA Hiroyuki
2008-11-06 11:25 ` Daisuke Nishimura
2008-11-06 12:44 ` KAMEZAWA Hiroyuki
2008-11-07 1:19 ` Daisuke Nishimura
2008-11-05 8:23 ` [RFC][PATCH 5/6] memcg: mem+swap controller KAMEZAWA Hiroyuki
2008-11-07 9:02 ` Daisuke Nishimura
2008-11-07 9:19 ` KAMEZAWA Hiroyuki
2008-11-07 13:30 ` Daisuke Nishimura
2008-11-07 13:21 ` Daisuke Nishimura
2008-11-10 4:30 ` Daisuke Nishimura
2008-11-10 7:03 ` KAMEZAWA Hiroyuki
2008-11-05 8:24 ` [RFC][PATCH 6/6] memcg: synchronized LRU KAMEZAWA Hiroyuki
2008-11-06 6:54 ` [RFC][PATCH 0/6] memcg updates (05/Nov) Balbir Singh
2008-11-06 7:03 ` KAMEZAWA Hiroyuki
2008-11-06 10:41 ` [RFC][PATCH 7/6] memcg: add atribute (for change bahavior of rmdir) KAMEZAWA Hiroyuki
2008-11-06 11:59 ` Hugh Dickins
2008-11-06 12:47 ` [RFC][PATCH 7/6] memcg: add atribute (for change bahavior ofrmdir) KAMEZAWA Hiroyuki
2008-11-06 13:46 ` [RFC][PATCH 7/6] memcg: add atribute (for change bahavior of rmdir) Balbir Singh
2008-11-06 14:30 ` [RFC][PATCH 7/6] memcg: add atribute (for change bahavior ofrmdir) KAMEZAWA Hiroyuki
2008-11-07 1:12 ` KAMEZAWA Hiroyuki
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=20081107181303.7dd232fd.kamezawa.hiroyu@jp.fujitsu.com \
--to=kamezawa.hiroyu@jp.fujitsu.com \
--cc=balbir@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=menage@google.com \
--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