From: Wei Liu Subject: Re: Xen balloon driver improvement (version 1) Date: Thu, 23 Oct 2014 17:12:56 +0100 Message-ID: <20141023161256.GN9188@zion.uk.xensource.com> References: <20141022162930.GA8489@zion.uk.xensource.com> <54491100.8090100@citrix.com> <20141023152322.GL9188@zion.uk.xensource.com> <54492560.50402@citrix.com> <1414080290.15687.9.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1414080290.15687.9.camel@citrix.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: Ian Campbell Cc: Wei Liu , Stefano Stabellini , Andrew Cooper , xen-devel@lists.xen.org, David Vrabel , Boris Ostrovsky , Roger Pau =?iso-8859-1?Q?Monn=E9?= List-Id: xen-devel@lists.xenproject.org On Thu, Oct 23, 2014 at 05:04:50PM +0100, Ian Campbell wrote: [...] > > >> For example I know FreeBSD has contigmalloc(9)[1] which I think could be > > >> used to achieve this. You could start asking for pages starting at > > >> maxpfn and go down from there, keeping fragmentation at a minimum. > > >> > > >> [1] > > >> https://www.freebsd.org/cgi/man.cgi?query=contigmalloc&apropos=0&sektion=0&manpath=FreeBSD+10.1-RELEASE&arch=default&format=html > > >> > > > > > > Good point. Just that Linux doesn't have a counterpart, not that I know > > > of. Memblock infrastructure looks similar but it's supposed to be used > > > when initialising kernel. > > > > > > Even if Linux has similar API, it's still less desirable because to > > > satisfy a contiguous PA allocation, the system needs to be relative > > > quiet (if NO_WAIT / ATOMIC is set), or the API needs to sleep for > > > indefinite period (wait for memory subsystem to squeeze out pages). > > > > There's no restriction on the time it might take for a guest to balloon > > out. IMHO I would rather add a new interface to the Linux VM subsystem > > that tries to accomplish this rather than adding a bunch of logic > > specific to the balloon driver. > > AIUI this already exists and Wei is simply hooking up the necessary > callbacks into the balloon driver. > That's right. > Ian.