lkml.org 
[lkml]   [2008]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 2/6] memcg: handle swap cache
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



\
 
 \ /
  Last update: 2008-11-07 10:17    [W:0.101 / U:1.664 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site