From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: Claim mode and HVM PoD interact badly Date: Fri, 10 Jan 2014 11:08:54 -0500 Message-ID: <20140110160854.GD21360@phenom.dumpdata.com> References: <20140110115638.GG29180@zion.uk.xensource.com> <1389355182.19142.38.camel@kazak.uk.xensource.com> <20140110145807.GB19124@phenom.dumpdata.com> <20140110151048.GC30581@zion.uk.xensource.com> <20140110154105.GC20640@phenom.dumpdata.com> <20140110154831.GE30581@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20140110154831.GE30581@zion.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Wei Liu Cc: Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Fri, Jan 10, 2014 at 03:48:31PM +0000, Wei Liu wrote: > On Fri, Jan 10, 2014 at 10:41:05AM -0500, Konrad Rzeszutek Wilk wrote: > > On Fri, Jan 10, 2014 at 03:10:48PM +0000, Wei Liu wrote: > > > On Fri, Jan 10, 2014 at 09:58:07AM -0500, Konrad Rzeszutek Wilk wrote: > > > > On Fri, Jan 10, 2014 at 11:59:42AM +0000, Ian Campbell wrote: > > > > > create ^ > > > > > owner Wei Liu > > > > > thanks > > > > > > > > > > On Fri, 2014-01-10 at 11:56 +0000, Wei Liu wrote: > > > > > > When I have following configuration in HVM config file: > > > > > > memory=128 > > > > > > maxmem=256 > > > > > > and have claim_mode=1 in /etc/xen/xl.conf, xl create fails with > > > > > > > > > > > > xc: error: Could not allocate memory for HVM guest as we cannot claim memory! (22 = Invalid argument): Internal error > > > > > > libxl: error: libxl_dom.c:647:libxl__build_hvm: hvm building failed > > > > > > libxl: error: libxl_create.c:1000:domcreate_rebuild_done: cannot (re-)build domain: -3 > > > > > > libxl: error: libxl_dm.c:1467:kill_device_model: unable to find device model pid in /local/domain/82/image/device-model-pid > > > > > > libxl: error: libxl.c:1425:libxl__destroy_domid: libxl__destroy_device_model failed for 82 > > > > > > > > > > > > With claim_mode=0, I can sucessfuly create HVM guest. > > > > > > > > > > Is it trying to claim 256M instead of 128M? (although the likelyhood > > > > > > > > No. 128MB actually. > > > > > > > > > > Huh? My debug message says otherwise. It tried to claim 248MB (256MB - > > > 8MB video ram). Did I misread your message... > > > > The 'claim' being the hypercall to set the 'clamp' on how much memory > > the guest can allocate. This is based on: > > > > 242 unsigned long i, nr_pages = args->mem_size >> PAGE_SHIFT; > > > > /* try to claim pages for early warning of insufficient memory available */ > > 337 if ( claim_enabled ) { > > 343 rc = xc_domain_claim_pages(xch, dom, nr_pages - cur_pages); > > > > Your 'mem_size' is 128MB, cur_pages is 0xc0, so it ends up 'claiming' > > that the guest only needs 128MB - 768kB. > > No, the nr_pages I saw was 63296 (256MB - 768KB) -- I printed it out. Then my patch should have made no difference in your case. Odd. > > Wei.