From: "Dan Magenheimer" Subject: RE: [PATCH] linux/balloon: don't allow ballooningdowna domain below a reasonable limit Date: Thu, 1 May 2008 17:27:53 -0600 Message-ID: <20080501172753703.00000002360@djm-pc> References: <20080502000310.361b9c99@core> Reply-To: "dan.magenheimer@oracle.com" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20080502000310.361b9c99@core> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Alan Cox , Keir Fraser Cc: Ky Srinivasan , "xen-devel@lists.xensource.com" , KurtGarloff , Jan Beulich List-Id: xen-devel@lists.xenproject.org > > It might be the case though that, in practice, vm_committed_space is a > > reasonable predictor for working set for some common types of workload.= Many > > applications probably keep their heaps fairly warm and hence in main me= mory. Yes, and it also seems to be an "advance" predictor so that the balloon driver has an opportunity to release pages to a soon-to-be-memory-hungry domain before it really needs them (or in case it might). > I am dubious. What vm_committed_space does allow you to do = > however if you > watch it in Xen is to actually ensure you never balloon out a virtual > machine to the point you make it start killing stuff off. Oddly, this is the opposite of what I observed. When I replaced Jan's minimum_target calculation in the balloon driver with just vm_committed_space (accidentally), I got lots of OOM's when I was shutting down. So vm_committed_space CAN shrink too far sometime and needs to be lower-bounded by some other calculated minimum. > There are better ways to measure memory pressure - sizes of the various > active and inactive lists etc. OLPC has code for this and a proposed > memory pressure notifier feature that they use to allow user space apps > to cleanup. Definitely agreed that vm_committed_space is just intended to be a first order approximation. It also has the advantage of having been around awhile so that the balloon driver will work with many distros rather than require a TBD memory pressure indicator. Alan, do you have a pointer to the proposed OLPC code? Keir, I'm working on some xenbus support and will submit an updated patch, probably early next week. I also have a horrible hack to work in a module, but I suspect that will get jettisoned. ;-) Thanks, Dan