From: George Dunlap Subject: Re: How to determine memory size in HVM Date: Wed, 10 Jun 2009 11:47:26 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Steven Smith , James Harper , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Tue, Jun 9, 2009 at 6:38 AM, Keir Fraser wrote: > > The new HVM populate-on-demand memory support should be able to help. I > suppose also some tools changes may be necessary in conjunction with this. > Or domain config changes. George Dunlap and Steven Smith can probably > advise. I know all about the populate-on-demand stuff, but not very much about the tools, and unfortunately that's where the change is needed, I think. :-) So the basic thing we need is to have not a single memory variable, but two variables: "maximum" and "target". Maximum is what is reported to a VM at boot, and target is how much we want it to actually have. What populate-on-demand allows you to do is to tell a fully virtualized VM it has maximum memory (say, 1G), but only give it target memory (say, 256M). When the VM boots, the OS will check its e820 mapping, see 1G reported there, and set things up appropriately. Then, when the balloon driver comes up, it will inflate the balloon to maxmem-target. The problem with rebooting sounds like it's due to the tools not being designed with this distinction in mind. So "xm mem-set" should change target, but not maxmem; and ideally, when the VM reboots, it should be created with the (maxmem,target) populate-on-demand split again. -George