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

From: KAMEZAWA Hiroyuki
Date: Fri May 29 2009 - 02:55:29 EST


On Fri, 29 May 2009 15:05:25 +0900
Daisuke Nishimura <nishimura@xxxxxxxxxxxxxxxxx> wrote:

> On Fri, 29 May 2009 14:37:58 +0900, KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:
> > On Fri, 29 May 2009 14:08:32 +0900
> > KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxxx>
>
>
> 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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/