All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Dingwall <james@dingwall.me.uk>
To: xen-devel@lists.xen.org
Subject: [patch] honour maxmem from config
Date: Tue, 15 Aug 2017 05:36:53 +0100	[thread overview]
Message-ID: <20170815043652.GA36547@dingwall.me.uk> (raw)

[-- Attachment #1: Type: text/plain, Size: 1101 bytes --]

Hi,

>From xl.cfg(5):

maxmem=MBYTES
           Specifies the maximum amount of memory a guest can ever see.  The value of maxmem= must be equal or greater than memory=.

           In combination with memory= it will start the guest "pre-ballooned", if the values of memory= and maxmem= differ.

At present when creating (pv) domains with a configuration such as:

memory = 512
maxmem = 1024

The maximum memory of the guest will not go above 512 (this also shows in the maxmem column in xl top).  I expect that the vm will start with 512 and then be 
able to increase up to 1024 if there is memory available for xen to allocate and the guest is under memory pressure.  I have been carrying variations of this 
patch originally written by Wei Liu through 4.[345] and having just jumped to 4.8 noted it is still a problem so thought I would raise this again.  With this 
applied everything is stable and working as expected - Xen 4.8.1 + Linux 4.1.43 (dom0 and guest) with tmem enabled in Xen, dom0 and guest.

https://lists.xenproject.org/archives/html/xen-devel/2013-10/msg02228.html

Thanks,
James

[-- Attachment #2: xen-tools-4.8-maxmem.patch --]
[-- Type: text/x-diff, Size: 509 bytes --]

diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index d519c8d440..0b6d81e53a 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -416,7 +416,7 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid,
         return ERROR_FAIL;
     }
 
-    if (xc_domain_setmaxmem(ctx->xch, domid, info->target_memkb + size) < 0) {
+    if (xc_domain_setmaxmem(ctx->xch, domid, info->max_memkb + size) < 0) {
         LOGE(ERROR, "Couldn't set max memory");
         return ERROR_FAIL;
     }

[-- Attachment #3: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

             reply	other threads:[~2017-08-15  4:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-15  4:36 James Dingwall [this message]
2017-08-15  9:13 ` [patch] honour maxmem from config James Dingwall

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=20170815043652.GA36547@dingwall.me.uk \
    --to=james@dingwall.me.uk \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.