From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: a ton of kernel issues Date: Wed, 14 Dec 2011 12:21:41 +0000 Message-ID: <4EE894D5.5010107@citrix.com> References: <4EE675A8.3030609@niemail.de> <4EE71663.5040308@gmail.com> <4EE72A94.6040904@gmail.com> <4EE75080.1000909@citrix.com> <1323783428.20077.298.camel@zakaz.uk.xensource.com> <4EE7BC9B.6040003@gmail.com> <1323815427.20936.96.camel@dagon.hellion.org.uk> <4EE7D75B.6080209@gmail.com> <1323847523.20936.110.camel@dagon.hellion.org.uk> <1323864969.20077.405.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1323864969.20077.405.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Campbell Cc: "xen-devel@lists.xensource.com" , George Shuklin , "sandr8@gmail.com" , Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org On 14/12/11 12:16, Ian Campbell wrote: > On Wed, 2011-12-14 at 07:25 +0000, Ian Campbell wrote: >> >> It controls precisely the behaviour you need! Try "maxmem=2048" and >> "memory=1024" in your guest configuration, it should boot with 1G of >> RAM and allow you to balloon to 2G and back. > > I take it back, there is indeed a bug in the PV ops kernel in this > regard. > > It works with xm/xend because they set the maximum reservation for > guests to static-max on boot. xl (and, I think, xapi) instead set the > maximum reservation to the current balloon target and change it > dynamically as the target is changed (as a method of enforcing the > targets). However the pvops kernel incorrectly uses the maximum > reservation at boot to size the physical address space for guests. > > The patch below fixes this. > > Ian. > > 8<------------------------------------------------------------- > > From 649ca3b7ddca1cdda85c27e34f806f30484172ec Mon Sep 17 00:00:00 2001 > From: Ian Campbell > Date: Wed, 14 Dec 2011 12:00:38 +0000 > Subject: [PATCH] xen: only limit memory map to maximum reservation for domain 0. > > d312ae878b6a "xen: use maximum reservation to limit amount of usable RAM" > clamped the total amount of RAM to the current maximum reservation. This is > correct for dom0 but is not correct for guest domains. In order to boot a guest > "pre-ballooned" (e.g. with memory=1G but maxmem=2G) in order to allow for > future memory expansion the guest must derive max_pfn from the e820 provided by > the toolstack and not the current maximum reservation (which can reflect only > the current maximum, not the guest lifetime max). The existing algorithm > already behaves this correctly if we do not artificially limit the maximum > number of pages for the guest case. [...] > Signed-off-by: Ian Campbell > Cc: stable@kernel.org > Cc: David Vrabel > Cc: Konrad Rzeszutek Wilk Acked-by: David Vrabel or Reviewed-by if that's more appropriate. David