From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: Re: domain creation vs querying free memory (xend and xl) Date: Thu, 4 Oct 2012 22:18:49 +0200 Message-ID: <20121004201848.GA26455@aepfle.de> References: <53b8c758-2675-42a7-b63f-4f9ad0006d84@default> <20581.55931.246130.308384@mariner.uk.xensource.com> <8ba2021c-1095-4fd1-98a5-f6eec8a3498b@default> <20121004182613.GA9244@aepfle.de> <18147469-adb0-4a86-b36f-231cb412d112@default> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <18147469-adb0-4a86-b36f-231cb412d112@default> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dan Magenheimer Cc: Keir Fraser , Konrad Wilk , George Dunlap , Kurt Hackel , tim@xen.org, xen-devel@lists.xen.org, George Shuklin , Dario Faggioli , Andres Lagar-Cavilla , Ian Jackson List-Id: xen-devel@lists.xenproject.org On Thu, Oct 04, Dan Magenheimer wrote: > > From: Olaf Hering [mailto:olaf@aepfle.de] > > Subject: Re: [Xen-devel] domain creation vs querying free memory (xend and xl) > > > > On Mon, Oct 01, Dan Magenheimer wrote: > > > > Hi Olaf -- > > Thanks for the reply. > > > domain. All of this needs math, not locking. > > : > > As IanJ said, the memory handling code in libxl needs such a feature to > > do the math right. The proposed handling of > > sharing/paging/ballooning/PoD/tmem/... in libxl is just a small part of > > it. > > Unfortunately, as you observe in some of the cases earlier in your reply, > it is more than a math problem for libxl... it is a crystal ball problem. > If xl launches a domain D at time T and it takes N seconds before it has > completed asking the hypervisor for all of the memory M that D will require > to successfully launch, then xl must determine at time T the maximum memory > allocated across all running domains for the future time period between > T and T+N. In other words, xl must predict the future. I think xl can predict it, if it takes the target of all domains into account. Certainly not down to a handful pages, it would be good enough to know if the calculated estimate of free memory is good for the new guest and its specific memory targets. > Clearly this is impossible especially when page-sharing is not communicating > its dynamic allocations (e.g. due to page-splitting) to libxl, and tmem > is not communicating allocations resulting from multiple domains > simultaenously making tmem hypercalls to libxl, and PoD is not communicating > its allocations to libxl, and in-guest-kernel selfballooning is not communicating > allocations to libxl. Only the hypervisor is aware of every dynamic allocation > request. The hypervisor can not predict the future either, and it has even less info about the individual targets of each domain. > Does that make sense? It does, but: If xl reserves the memory in its own "virtual allocator", or if Xen gets such functionality, does not really matter, as long as its known how much exactly needs to be allocated. I think that part is missing. Olaf