xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@novell.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Charles Arnold <CARNOLD@novell.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: Xen 4.0.1 "xc_map_foreign_batch: mmap failed: Cannot allocate memory"
Date: Fri, 07 Jan 2011 12:37:10 +0000	[thread overview]
Message-ID: <4D271706020000780002AFB2@vpn.id2.novell.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1101071115280.2390@kaball-desktop>

>>> On 07.01.11 at 12:18, Stefano Stabellini <stefano.stabellini@eu.citrix.com>
wrote:
> On Fri, 7 Jan 2011, Jan Beulich wrote:
>> >>> On 06.01.11 at 21:49, Charles Arnold wrote:
>> > >>> On 1/6/2011 at 10:14 AM, in message <4D25C782.5B74.0091.0@novell.com>, 
> Charles Arnold wrote: 
>> > Attached is the messages file with the printk output.
>> 
>> Hmm, a failure due to may_expand_vm() is really odd. Something
>> must be explicitly setting a non-infinite RLIMIT_AS on qemu-dm (or
>> one of its parents), as the default is "infinite" (as reaching "infinity"
>> - being ~0UL - is simply impossible, and unduly large lengths should
>> be caught by get_unmapped_area() already).
>> 
>> /proc/<pid>/limits would at least tell us what the limit is.
>> 
> 
> Knowing this would be very interesting.

I just found that on SLE11 this gets set to 80% (admin controllable)
of the sum of physical (not accounting for the balloon) and swap
memory. That's (at least on large systems using a relatively low
dom0_mem= value) likely awfully low for qemu-dm serving large
guests.

However, it's only rlim_cur that gets set this low by default, and
hence it would seem reasonable to me to have qemu-dm bump it
to whatever getrlimit() returns in rlimit_max.

>> And certainly qemu-dm needs to be prepared to have a
>> non-infinite address space limit set on it.
>> 
> 
> Currently the number of buckets and the bucket size in the mapcache are
> statically defined depending on x86_32/x86_64.
> It shouldn't be difficult to make them dynamic depending on RLIMIT_AS.

That still wouldn't help if RLIMIT_AS gets changed when it's already
running. The only proper way to deal with the situation as a whole
(including but not limited to rlim_max being relatively low) is to get
proper error handling implemented, either causing guest I/O to be
throttled when mmap() fails, or no longer used mappings cleared
(if that isn't being done already).

Jan

  reply	other threads:[~2011-01-07 12:37 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-07  9:35 Xen 4.0.1 "xc_map_foreign_batch: mmap failed: Cannot allocate memory" Jan Beulich
2011-01-07 11:18 ` Stefano Stabellini
2011-01-07 12:37   ` Jan Beulich [this message]
2011-01-10 11:11     ` Stefano Stabellini
2011-01-07 17:03   ` Charles Arnold
  -- strict thread matches above, loose matches on Subject: below --
2011-01-06 20:49 Charles Arnold
2011-01-05 18:10 Jan Beulich
2010-12-16 19:23 Charles Arnold
2010-12-16 20:33 ` Keir Fraser
2010-12-16 20:44   ` Charles Arnold
2010-12-16 20:54     ` Keir Fraser
2010-12-17  9:22       ` Jan Beulich
2010-12-17 10:06         ` Keir Fraser
2011-01-05 14:37       ` Stefano Stabellini
2011-01-05 15:30         ` Jan Beulich
2011-01-05 16:22           ` Stefano Stabellini
2011-01-05 16:33             ` Jan Beulich
2011-01-05 17:48               ` Stefano Stabellini
2011-01-05 18:09                 ` Jan Beulich
2011-01-05 17:17         ` Charles Arnold
2011-01-06 16:50           ` Stefano Stabellini
2011-01-06 17:14             ` Charles Arnold

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=4D271706020000780002AFB2@vpn.id2.novell.com \
    --to=jbeulich@novell.com \
    --cc=CARNOLD@novell.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /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).