xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: James Dingwall <james.dingwall@zynstra.com>
To: Bob Liu <bob.liu@oracle.com>
Cc: xen-devel@lists.xen.org
Subject: Re: Kernel 3.11 / 3.12 OOM killer and Xen ballooning
Date: Wed, 29 Jan 2014 14:45:24 +0000	[thread overview]
Message-ID: <52E91404.30602@zynstra.com> (raw)
In-Reply-To: <52E911CA.9020700@oracle.com>

Bob Liu wrote:
> On 01/29/2014 01:15 AM, James Dingwall wrote:
>> Bob Liu wrote:
>>> I have made a patch by reserving extra 10% of original total memory, by
>>> this way I think we can make the system much more reliably in all cases.
>>> Could you please have a test? You don't need to set
>>> selfballoon_reserved_mb by yourself any more.
>> I have to say that with this patch the situation has definitely
>> improved.  I have been running it with 3.12.[78] and 3.13 and pushing it
>> quite hard for the last 10 days or so.  Unfortunately yesterday I got an
> Good news!
>
>> OOM during a compile (link) of webkit-gtk.  I think your patch is part
>> of the solution but I'm not sure if the other bit is simply to be more
>> generous with the guest memory allocation or something else.  Having
>> tested with memory = 512  and no tmem I get an OOM with the same
>> compile, with memory = 1024 and no tmem the compile completes ok (both
>> cases without maxmem).  As my domains are usually started with memory =
>> 512 and maxmem = 1024 it seems that there should be sufficient with my
> But I think from the beginning tmem/balloon driver can't expand guest
> memory from size 'memory' to 'maxmem' automatically.
I am carrying this patch for libxl (4.3.1) because maxmem wasn't being 
honoured.

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);

>
>> default parameters. Also for an experiment I set memory=1024 and removed
>> maxmem and when tmem is activated I see "[ 3393.884105] xen:balloon:
>> reserve_additional_memory: add_memory() failed: -17" printed many times
>> in the guest kernel log.
>>
> I'll take a look at it.
It seems possible that this could be the same cause as for the message 
being printed in dom0 and which I reported in 
http://lists.xen.org/archives/html/xen-devel/2012-12/msg01607.html and 
for which no fix seems to have made it to the kernel.  I'm still working 
around this with:

#!/bin/sh

CURRENT_KB="/sys/bus/xen_memory/devices/xen_memory0/info/current_kb"
TARGET_KB="/sys/bus/xen_memory/devices/xen_memory0/target_kb"

CKB=$(< "${CURRENT_KB}")
TKB=$(< "${TARGET_KB}")

if [ "${TKB}" -gt "${CKB}" ] ; then
         echo "Resizing dom0 memory balloon target to ${CKB}"
         echo "${CKB}" > "${TARGET_KB}"
fi

Thanks,
James


-- 

*James Dingwall*

Script Monkey

zynstra-signature-logo <http://www.zynstra.com/>twitter-black 
<http://www.twitter.com/zynstra>linkedin-black 
<http://www.linkedin.com/company/zynstra>

Zynstra is a private limited company registered in England and Wales 
(registered number 07864369).  Our registered office is 5 New Street 
Square, London, EC4A 3TW and our headquarters are at Bath Ventures, 
Broad Quay, Bath, BA1 1UD.

  reply	other threads:[~2014-01-29 14:45 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-09 17:50 Kernel 3.11 / 3.12 OOM killer and Xen ballooning James Dingwall
2013-12-09 21:48 ` Konrad Rzeszutek Wilk
2013-12-10 14:52   ` James Dingwall
2013-12-10 15:27     ` Konrad Rzeszutek Wilk
2013-12-11  7:22       ` Bob Liu
2013-12-11  9:25         ` James Dingwall
2013-12-11  9:54           ` Bob Liu
2013-12-11 10:16             ` James Dingwall
2013-12-11 16:30         ` James Dingwall
2013-12-12  1:03           ` Bob Liu
2013-12-13 16:59             ` James Dingwall
2013-12-17  6:11               ` Bob Liu
2013-12-18 12:04           ` Bob Liu
2013-12-19 19:08             ` James Dingwall
2013-12-20  3:17               ` Bob Liu
2013-12-20 12:22                 ` James Dingwall
2013-12-26  8:42                 ` James Dingwall
2014-01-02  6:25                   ` Bob Liu
2014-01-07  9:21                     ` James Dingwall
2014-01-09 10:48                       ` Bob Liu
2014-01-09 10:54                         ` James Dingwall
2014-01-09 11:04                         ` James Dingwall
2014-01-15  8:49                         ` James Dingwall
2014-01-15 14:41                           ` Bob Liu
2014-01-15 16:35                             ` James Dingwall
2014-01-16  1:22                               ` Bob Liu
2014-01-16 10:52                                 ` James Dingwall
2014-01-28 17:15                                 ` James Dingwall
2014-01-29 14:35                                   ` Bob Liu
2014-01-29 14:45                                     ` James Dingwall [this message]
2014-01-31 16:56                                       ` Konrad Rzeszutek Wilk
2014-02-03  9:49                                         ` Daniel Kiper
2014-02-03 10:30                                           ` Konrad Rzeszutek Wilk
2014-02-03 11:20                                           ` James Dingwall
2014-02-03 14:00                                             ` Daniel Kiper
2013-12-10  8:16 ` Jan Beulich
2013-12-10 14:01   ` James Dingwall
2013-12-10 14:25     ` Jan Beulich
2013-12-10 14:52       ` James Dingwall
2013-12-10 14:59         ` Jan Beulich
2013-12-10 15:16           ` 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=52E91404.30602@zynstra.com \
    --to=james.dingwall@zynstra.com \
    --cc=bob.liu@oracle.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).