From: Wei Liu Subject: Re: Bug - Xen 4.3 - xl ignores maxmem setting in domU config file Date: Tue, 29 Oct 2013 10:59:21 +0000 Message-ID: <20131029105921.GB5221@zion.uk.xensource.com> References: <20131029102600.GA23307@dingwall.me.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20131029102600.GA23307@dingwall.me.uk> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: James Dingwall Cc: wei.liu2@citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Tue, Oct 29, 2013 at 10:26:00AM +0000, James Dingwall wrote: > Hi, > > I am having some memory ballooning problems which only seem to have > appeared since upgrading to Xen 4.3. In short if I set the domU > configuration file as: > > memory = 512 > maxmem = 1024 > > Then even under memory pressure the guest domain does not balloon past > the value of the 'memory' parameter. > > xl info shows plenty of available memory in dom0: > total_memory : 32767 > free_memory : 12445 > > > xl list -l on the domain shows: > "max_memkb": 1048576, > "target_memkb": 524288, > This is parsed from your config file so they should always look OK to you. Does the following patch help? Git blame tells me the change to set maxmem to target_memkb was introduced 4 years ago so I suspect there's reason to do that. If we cannot fix it here we need to insert the corresponding call later. Wei. ----8<--- diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c index 356f920..fb7965d 100644 --- a/tools/libxl/libxl_dom.c +++ b/tools/libxl/libxl_dom.c @@ -235,7 +235,7 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid, libxl_domain_set_nodeaffinity(ctx, domid, &info->nodemap); libxl_set_vcpuaffinity_all(ctx, domid, info->max_vcpus, &info->cpumap); - xc_domain_setmaxmem(ctx->xch, domid, info->target_memkb + LIBXL_MAXMEM_CONSTANT); + xc_domain_setmaxmem(ctx->xch, domid, info->max_memkb + LIBXL_MAXMEM_CONSTANT); xs_domid = xs_read(ctx->xsh, XBT_NULL, "/tool/xenstored/domid", NULL); state->store_domid = xs_domid ? atoi(xs_domid) : 0; free(xs_domid);