From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Latimer Subject: Re: freemem-slack and large memory environments Date: Fri, 27 Feb 2015 11:29:12 -0700 Message-ID: <8145398.E30EXKdkiW@mlatimer1.dnsdhcp.provo.novell.com> References: <4321015.nah3j6dvJq@mlatimer1.dnsdhcp.provo.novell.com> <3226285.BhjaSCDldb@mlatimer1.dnsdhcp.provo.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <3226285.BhjaSCDldb@mlatimer1.dnsdhcp.provo.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: xen-devel@lists.xen.org Cc: wei.liu2@citrix.com, ian.jackson@eu.citrix.com, Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Friday, February 27, 2015 08:28:49 AM Mike Latimer wrote: > On Friday, February 27, 2015 10:52:17 AM Stefano Stabellini wrote: > > On Thu, 26 Feb 2015, Mike Latimer wrote: > > > libxl_set_memory_target = 1 > > > > The new memory target is set for dom0 successfully. > > > > > libxl_wait_for_free_memory = -5 > > > > Still there isn't enough free memory in the system. > > > > > libxl_wait_for_memory_target = 0 > > > > However dom0 reached the new memory target already. > > Who is stealing your memory? > > I just realized I was missing commit 2048aeec, which corrects the hardcoded > return value of libxl_wait_for_memory_target from 0 to rc. I'll retest with > this change in place. > > > In any case in the context of libxl_wait_for_memory_target, ERROR_FAIL > > means that the memory target has not been reached. > > I'm expecting this commit to to change what I'm seeing, but I'm not > convinced it will be a good change... There is zero chance dom0 will > balloon down 64GB (or 512GB) in the 10 second window set by freemem. This > will likely mean the entire process will fail (when given a bit more time > it would have succeeded). > > I'll add the missing commit, and send a complete set of debug logs later > today. After adding 2048aeec, dom0's target is lowered by the required amount (e.g. 64GB), but as dom0 cannot balloon down fast enough, libxl_wait_for_memory_target returns -5, and the domain create fails ("failed to free memory for the domain"). As dom0's target was lowered successfully, dom0 continues to balloon down in the background. So, after waiting a while, the domain creation will succeed. This is one of the problems I would like to solve. As the ballooning is working (just taking longer than expected) the code should monitor it and wait somehow. I'll send in detailed logs (without 2048aeec) later today, to make sure I've explained this well enough. -Mike