xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: James Dingwall <james-xen@dingwall.me.uk>
To: Wei Liu <wei.liu2@citrix.com>
Cc: James Dingwall <james-xen@dingwall.me.uk>, xen-devel@lists.xen.org
Subject: Re: Bug - Xen 4.3 - xl ignores maxmem setting in domU config file
Date: Tue, 29 Oct 2013 11:40:38 +0000	[thread overview]
Message-ID: <20131029114038.GA25655@dingwall.me.uk> (raw)
In-Reply-To: <20131029105921.GB5221@zion.uk.xensource.com>

On Tue, Oct 29, 2013 at 10:59:21AM +0000, Wei Liu wrote:
> 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);
> 

This patch solves the problem for me where maxmem in config file is not 
honoured during domain creation.  With it applied xl top immediately 
shows the correct value in the MAXMEM column.

I can see that xl_cmdimpl.c safely sets max_memkb for the case where the 
configuration file does not define maxmem.

Thanks,
James



-- 
------------------------------------------------------------------------
James Dingwall
e: james@dingwall.me.uk
w: http://www.dingwall.me.uk/
------------------------------------------------------------------------

      parent reply	other threads:[~2013-10-29 11:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-29 10:26 Bug - Xen 4.3 - xl ignores maxmem setting in domU config file James Dingwall
2013-10-29 10:59 ` Wei Liu
2013-10-29 11:06   ` Andrew Cooper
2013-10-29 12:08     ` Wei Liu
2013-10-29 14:49       ` Konrad Rzeszutek Wilk
2013-10-29 18:02         ` Daniel Kiper
2013-10-30 11:39           ` Wei Liu
2013-10-31 13:35             ` Daniel Kiper
2013-10-29 11:40   ` James Dingwall [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131029114038.GA25655@dingwall.me.uk \
    --to=james-xen@dingwall.me.uk \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).