Re: [PATCH 1/4] add swap cache interface for swap reference v2 (updated)

KAMEZAWA Hiroyuki
2009-05-29T06:55:26Z

On Fri, 29 May 2009 15:05:25 +0900
Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> wrote:

> On Fri, 29 May 2009 14:37:58 +0900, KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:
> > On Fri, 29 May 2009 14:08:32 +0900
> > KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:
> > > > IIUC, swap_free() at the end of shmem_writepage() should also be changed to swapcache_free().
> > > >
> > > Hmm!. Oh, yes. shmem_writepage()'s error path. Thank you. It will be fixed.
> > >
> > here.
> >
> Looks good to me.
>
> Reviewed-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
>
>
> BTW, I'm now testing(with swap-in/out and swap-on/off) [2/4] of this patch set.
> I think this patch set would work well, but it's a big change to swap,
> so we should test them very carefully.
>
Indeed.

BTW, even we ignores memcg, they are necessary change for us. ([2/4] and [3/4])

IIUC, I remember a NEC man had a story like below.

1. create 2 cpusets. A and B.
2. At first, tons of swaps are created by "A".
3. After size of applications in A shrinks, pages swapped out by "A" is now on-memory.
4. When running program in B, B can't use enough swaps because "A" uses tons of
cache-only swaps.

Why swap_entries are not reclaimed in "4" is because cpuset divides the LRU.

I think patch [3/4] can be a sliver bullet to this problem.

Thanks,
-Kame