Re: [RFC][PATCH 1/2] Linux/Guest unmapped page cache control

From: Balbir Singh
Date: Mon Jun 14 2010 - 03:37:12 EST

* KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> [2010-06-14 16:00:21]:

> On Mon, 14 Jun 2010 12:19:55 +0530
> Balbir Singh <balbir@xxxxxxxxxxxxxxxxxx> wrote:
> > > - Why don't you believe LRU ? And if LRU doesn't work well, should it be
> > > fixed by a knob rather than generic approach ?
> > > - No side effects ?
> >
> > I believe in LRU, just that the problem I am trying to solve is of
> > using double the memory for caching the same data (consider kvm
> > running in cache=writethrough or writeback mode, both the hypervisor
> > and the guest OS maintain a page cache of the same data). As the VM's
> > grow the overhead is substantial. In my runs I found upto 60%
> > duplication in some cases.
> >
> >
> > - Linux vm guys tend to say, "free memory is bad memory". ok, for what
> > free memory created by your patch is used ? IOW, I can't see the benefit.
> > If free memory that your patch created will be used for another page-cache,
> > it will be dropped soon by your patch itself.
> >
> > Free memory is good for cases when you want to do more in the same
> > system. I agree that in a bare metail environment that might be
> > partially true. I don't have a problem with frequently used data being
> > cached, but I am targetting a consolidated environment at the moment.
> > Moreover, the administrator has control via a boot option, so it is
> > non-instrusive in many ways.
> It sounds that what you want is to improve performance etc. but to make it
> easy sizing the system and to help admins. Right ?

Right, to allow freeing up of using double the memory to cache data.

> From performance perspective, I don't see any advantage to drop caches
> which can be dropped easily. I just use cpus for the purpose it may no
> be necessary.

It is not that easy, in a virtualized environment, you do directly
reclaim, but use a mechanism like ballooning and that too requires a
smart software to decide where to balloon from. This patch (optionally
if enabled) optimizes that by

1. Reducing double caching
2. Not requiring newer smarts or a management software to monitor and
3. Allows better estimation of free memory by avoiding double caching
4. Allows immediate use of free memory for other applications or
startup of newer guest instances.

Three Cheers,
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at