* [PATCH] Domain creation 4MB memory allocation
@ 2009-04-01 7:49 Michal Novotny
2009-04-01 9:06 ` Jan Beulich
0 siblings, 1 reply; 3+ messages in thread
From: Michal Novotny @ 2009-04-01 7:49 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 714 bytes --]
Hi,
I've found some problems when running 2 guests with and then trying to
install a new machine (no matter whether using virt-manager or
virt-install). I am attaching a patch that fixes this problem.
I was working on 8G box and I have done those things:
1. xm create PVguest maxmem=2500 memory=2500
2. xm create FVguest maxmem=2500 memory=2500
3. virt-install -l http://path/to/install/ -r 2500 -v --nodisks -n
someGuestName
Before applying this patch it returned "Cannot allocate memory" error
but after applying my patch it created a new domain and started
installation well but it's reproducible sometimes and not everytime.
Best regards,
Michal
Signed-off-by: Michal Novotny <minovotn@redhat.com>
[-- Attachment #2: xen-fv-guest-creation-4M-memory-allocation.patch --]
[-- Type: text/plain, Size: 887 bytes --]
diff -r d5ddc782bc49 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py Mon Mar 30 16:48:26 2009 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py Wed Apr 01 09:43:37 2009 +0200
@@ -2245,8 +2245,9 @@
# There is an implicit memory overhead for any domain creation. This
# overhead is greater for some types of domain than others. For
# example, an x86 HVM domain will have a default shadow-pagetable
- # allocation of 1MB. We free up 2MB here to be on the safe side.
- balloon.free(2*1024, self) # 2MB should be plenty
+ # allocation of 1MB. We free up 4MB here to be on the safe side.
+ # 2MB memory allocation was not enough in some cases, so it's 4MB now
+ balloon.free(4*1024, self) # 4MB should be plenty
ssidref = 0
if security.on() == xsconstants.XS_POLICY_USE:
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Domain creation 4MB memory allocation
2009-04-01 7:49 [PATCH] Domain creation 4MB memory allocation Michal Novotny
@ 2009-04-01 9:06 ` Jan Beulich
2009-04-01 9:48 ` Michal Novotny
0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2009-04-01 9:06 UTC (permalink / raw)
To: xen-devel, Michal Novotny
>>> Michal Novotny <minovotn@redhat.com> 01.04.09 09:49 >>>
>Hi,
>I've found some problems when running 2 guests with and then trying to
>install a new machine (no matter whether using virt-manager or
>virt-install). I am attaching a patch that fixes this problem.
>
>I was working on 8G box and I have done those things:
> 1. xm create PVguest maxmem=2500 memory=2500
> 2. xm create FVguest maxmem=2500 memory=2500
> 3. virt-install -l http://path/to/install/ -r 2500 -v --nodisks -n
>someGuestName
>
>Before applying this patch it returned "Cannot allocate memory" error
>but after applying my patch it created a new domain and started
>installation well but it's reproducible sometimes and not everytime.
This is just curing (actually not really curing, just reducing the likelihood of
its occurrence) a symptom, rather than the root cause: What if 4Mb turn
out to be insufficient for someone else on some other machine? In order
to guarantee hvm guest creation to be possible (at least in the case
where shadow paging is to be used - not sure about NPT/EPT's
requirements), there has to be a way to guarantee some small amount
of contiguous memory being available in Xen. Ballooning cannot guarantee
this, and after a longer period of up-time with many guests starting and
dying even using dom0_mem= on the Xen command line doesn't help due
to fragmentation being unavoidable.
Jan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Domain creation 4MB memory allocation
2009-04-01 9:06 ` Jan Beulich
@ 2009-04-01 9:48 ` Michal Novotny
0 siblings, 0 replies; 3+ messages in thread
From: Michal Novotny @ 2009-04-01 9:48 UTC (permalink / raw)
To: Jan Beulich, xen-devel
Jan Beulich wrote:
>>>> Michal Novotny <minovotn@redhat.com> 01.04.09 09:49 >>>
>>>>
>> Hi,
>> I've found some problems when running 2 guests with and then trying to
>> install a new machine (no matter whether using virt-manager or
>> virt-install). I am attaching a patch that fixes this problem.
>>
>> I was working on 8G box and I have done those things:
>> 1. xm create PVguest maxmem=2500 memory=2500
>> 2. xm create FVguest maxmem=2500 memory=2500
>> 3. virt-install -l http://path/to/install/ -r 2500 -v --nodisks -n
>> someGuestName
>>
>> Before applying this patch it returned "Cannot allocate memory" error
>> but after applying my patch it created a new domain and started
>> installation well but it's reproducible sometimes and not everytime.
>>
>
> This is just curing (actually not really curing, just reducing the likelihood of
> its occurrence) a symptom, rather than the root cause: What if 4Mb turn
> out to be insufficient for someone else on some other machine? In order
> to guarantee hvm guest creation to be possible (at least in the case
> where shadow paging is to be used - not sure about NPT/EPT's
> requirements), there has to be a way to guarantee some small amount
> of contiguous memory being available in Xen. Ballooning cannot guarantee
> this, and after a longer period of up-time with many guests starting and
> dying even using dom0_mem= on the Xen command line doesn't help due
> to fragmentation being unavoidable.
>
> Jan
>
>
Well, in fact setting it to 4MiB is no guarantee at all and this
information was done only by testing. Anyway the test case written above
is the problem I run into and this solved this issue. 2MiB was surely
not enough in my case and therefore I needed to patch it. Any other
ideas how to make it running fine? I've tested it on some other
configurations/platforms and it was working with no problems so 2MiB
were really not enough.
Michal
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-04-01 9:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-01 7:49 [PATCH] Domain creation 4MB memory allocation Michal Novotny
2009-04-01 9:06 ` Jan Beulich
2009-04-01 9:48 ` Michal Novotny
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.