From: "Charles Coffing" <ccoffing@novell.com>
To: xen-devel@lists.xensource.com
Subject: Re: 3.0.5-rc3: Creating HVM guest fails with: Cannot allocate memory
Date: Mon, 30 Apr 2007 14:59:08 -0400 [thread overview]
Message-ID: <4635E71F.D169.003C.0@novell.com> (raw)
In-Reply-To: <20070427132616.GC13642@redhat.com>
On Fri, Apr 27, 2007 at 7:26 AM, "Daniel P. Berrange" <berrange@redhat.com> wrote:
> On Fri, Apr 27, 2007 at 07:53:24AM +0100, Keir Fraser wrote:
>> On 27/4/07 00:12, "Daniel P. Berrange" <berrange@redhat.com> wrote:
>>
>> > The _constructDomain call is failing in xc.domain_create() - the code which
>> > deals with ballooning down Domain-0 is not even run yet - that lives in
>> > the _initDomain method. So HVM domain creation is failing before XenD has
>> > even had a chance to do ballooning. If I manually use 'xm mem-set' to
>> > balloon down Domain-0 ahead of time, everything works just fine.
>> >
>> > I'm at a lose to figure out how to solve this without major re-arranging
>> > of the order of _constructDomain & _initDomain work. Perhaps someone can
>> > figure out an easier fix ?
>>
>> I don't think domain_create() allocates very many pages, although it's
>> possible it's making a default allocation of shadow memory. Assuming not, it
>> may be sufficient to make auto-balloon leave a bit of slack memory rather
>> than try to account for all available memory down to the last page. A few
>> pages might turn out to suffice. Does this problem occur with the very first
>> domain you try to create after booting the machine?
>
> It seems to occurr with any HVM guest I try to create, unless there was
> already
> some free mem (from starting & stopping a previous dom). I'm testing with
> this
> very simple hack which seems to make it work - just ensure the balloon driver
> frees a 10 MB chunk right at the start. Hardcoding is fine because when we
> later get to the _initDomain() method we'll definitely be freeing up much
> more than 10 MB for the HVM guests's actual mem requirements.
Keir,
The problem Daniel fixed for fully virtual affects paravirtual, also.
We have received bug reports from ISVs of this problem in both the PV and FV cases. I traced code paths and discovered that FV attempts to allocate the most memory during the initial domain creation; 64-bit PV allocates the next most; 32-bit PV allocates the least. So failures for PV are less common, but not impossible.
Would you please de-indent the added lines, so both PV and FV guests have the 2 MB slack?
I've been testing such a patch for about a month in our SLES 10 SP1 betas (based on xen-3.0.4), and it works well.
Thanks.
> --- xen-3.0.5-testing.hg-rc3-14934/tools/python/xen/xend/XendDomainInfo.py
> 2007-04-26 19:30:11.000000000 -0400
> +++ xen-3.0.5-testing.hg-rc3-14934.new/tools/python/xen/xend/XendDomainInfo.py
> 2007-04-26 19:36:06.000000000 -0400
> @@ -1422,6 +1422,8 @@ class XendDomainInfo:
> raise VmError("HVM guest support is unavailable: is VT/AMD-V
> "
> "supported by your CPU and enabled in your "
> "BIOS?")
> + # Hack to pre-reserve some mem for basic HVM setup
> + balloon.free(10*1024)
>
> self.domid = xc.domain_create(
> domid = 0,
>
>
> Dan.
next prev parent reply other threads:[~2007-04-30 18:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-26 23:12 3.0.5-rc3: Creating HVM guest fails with: Cannot allocate memory Daniel P. Berrange
2007-04-27 6:53 ` Keir Fraser
2007-04-27 13:26 ` Daniel P. Berrange
2007-04-27 13:56 ` Keir Fraser
2007-04-27 14:09 ` Daniel P. Berrange
2007-04-27 14:27 ` Keir Fraser
2007-04-30 18:59 ` Charles Coffing [this message]
2007-04-30 19:11 ` Daniel P. Berrange
2007-04-30 21:55 ` Keir Fraser
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=4635E71F.D169.003C.0@novell.com \
--to=ccoffing@novell.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 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.