From: Ian Campbell Subject: Re: [RFC/PATCH v2] XENMEM_claim_pages (subop of existing) hypercall Date: Tue, 20 Nov 2012 10:16:21 +0000 Message-ID: <1353406581.13542.13.camel@zakaz.uk.xensource.com> References: <6f7c28bb-ffa9-4b39-929b-2a05d99a77e7@default> <1352982337.3499.119.camel@zakaz.uk.xensource.com> <1353062895.3499.205.camel@zakaz.uk.xensource.com> <50AB4A8602000078000A9E10@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <50AB4A8602000078000A9E10@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Dan Magenheimer , "xen-devel@lists.xen.org" , "Keir (Xen.org)" , KonradWilk , "Tim (Xen.org)" , Dave Mccracken , Zhigang Wang List-Id: xen-devel@lists.xenproject.org On Tue, 2012-11-20 at 08:16 +0000, Jan Beulich wrote: > >>> On 19.11.12 at 21:53, Dan Magenheimer wrote: > >> From: Ian Campbell [mailto:Ian.Campbell@citrix.com] > >> Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of > > existing) hypercall > > > > Hi Ian -- > > > >> On Thu, 2012-11-15 at 19:15 +0000, Dan Magenheimer wrote: > >> > > From: Ian Campbell [mailto:Ian.Campbell@citrix.com] > >> > > Subject: Re: [Xen-devel] [RFC/PATCH v2] XENMEM_claim_pages (subop of > > existing) hypercall > >> > > > >> > > On Wed, 2012-11-14 at 23:55 +0000, Dan Magenheimer wrote: > >> > > > >> > > How does this interact with the feature which lets you create PV guests > >> > > using only superpages? I believe is something Oracle added and still > >> > > maintains (Dave added to the CC). > >> > > > >> > > Also doesn't this fail to make any sort of guarantee if you are building > >> > > a 32 bit PV guest, since they require memory under a certain host > >> > > address limit (160GB IIRC)? > >> > > > >> > > Basically neither of those cases benefit from this hypercall at all? I > >> > > don't know what the usecase for the superpage PV guests is (but I > >> > > suppose it is important to Oracle, at least). The 32 bit PV guest use > >> > > case is still a pretty significant one which I think ought to be > >> > > handled, otherwise any system built on top of this functionality will > >> > > only work reliably in a subset of cases. > >> > > >> > The claim mechanism will not benefit PV superpages. IIUC, the > >> > design of the PV superpages will cause a domain launch to fail > >> > if it requests 10000 superpages but Xen can only successfully > >> > allocate 9999. That's already very fragile. Since the only > >> > way currently to find out if there are 10000 superpages available > >> > is to start allocating them, claim can't really help. > >> > >> Well, you could always account the number of free superpages in the > >> system, which would allow you to cover this case too. > > > > Because of the nature of the buddy allocator (i.e. 4MB chunks are > > kept separately from 2MB chunks even though a 4MB page contains > > two 2MB pages), I don't think this is trivial. > > This ought to be as simple as adding respective accounting > when > - splitting a chunk in alloc_heap_pages(), crossing the super page > size boundary, and > - merging chunks in free_heap_pages(), crossing the super page > size boundary. That was my first thought too. Ian.