On Tue, 2010-06-15 at 10:07 +0300, Avi Kivity wrote: > On 06/14/2010 08:58 PM, Dave Hansen wrote: > > On Mon, 2010-06-14 at 19:34 +0300, Avi Kivity wrote: > > > >>> Again, this is useless when ballooning is being used. But, I'm thinking > >>> of a more general mechanism to force the system to both have MemFree > >>> _and_ be acting as if it is under memory pressure. > >>> > >>> > >> If there is no memory pressure on the host, there is no reason for the > >> guest to pretend it is under pressure. > >> > > I can think of quite a few places where this would be beneficial. > > > > Ballooning is dangerous. I've OOMed quite a few guests by > > over-ballooning them. Anything that's voluntary like this is safer than > > things imposed by the host, although you do trade of effectiveness. > > That's a bug that needs to be fixed. Eventually the host will come > under pressure and will balloon the guest. If that kills the guest, the > ballooning is not effective as a host memory management technique. I'm not convinced that it's just a bug that can be fixed. Consider a case where a host sees a guest with 100MB of free memory at the exact moment that a database app sees that memory. The host tries to balloon that memory away at the same time that the app goes and allocates it. That can certainly lead to an OOM very quickly, even for very small amounts of memory (much less than 100MB). Where's the bug? I think the issues are really fundamental to ballooning. > > If all the guests do this, then it leaves that much more free memory on > > the host, which can be used flexibly for extra host page cache, new > > guests, etc... > > If the host detects lots of pagecache misses it can balloon guests > down. If pagecache is quiet, why change anything? Page cache misses alone are not really sufficient. This is the classic problem where we try to differentiate streaming I/O (which we can't effectively cache) from I/O which can be effectively cached. > If the host wants to start new guests, it can balloon guests down. If > no new guests are wanted, why change anything? We're talking about an environment which we're always trying to optimize. Imagine that we're always trying to consolidate guests on to smaller numbers of hosts. We're effectively in a state where we _always_ want new guests. -- Dave -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html