From: Wei Liu Subject: Re: [PATCH v2 1/4] Revert "libxl: Wait for ballooning if free memory is increasing" Date: Mon, 9 Mar 2015 11:15:29 +0000 Message-ID: <20150309111529.GM18491@zion.uk.xensource.com> References: <1425662357-9951-1-git-send-email-stefano.stabellini@eu.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: <1425662357-9951-1-git-send-email-stefano.stabellini@eu.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: Stefano Stabellini Cc: Ian.Jackson@eu.citrix.com, xen-devel@lists.xensource.com, wei.liu2@citrix.com, Ian.Campbell@citrix.com, mlatimer@suse.com List-Id: xen-devel@lists.xenproject.org On Fri, Mar 06, 2015 at 05:19:14PM +0000, Stefano Stabellini wrote: > This reverts commit 2563bca11544361dc2afa5e20b5663e10a0715cb. > Missing S-o-B. > Reviewed-by: Mike Latimer > Tested-by: Mike Latimer > --- > tools/libxl/xl_cmdimpl.c | 17 +++-------------- > 1 file changed, 3 insertions(+), 14 deletions(-) > > diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c > index e41f633..f4c4122 100644 > --- a/tools/libxl/xl_cmdimpl.c > +++ b/tools/libxl/xl_cmdimpl.c > @@ -2198,9 +2198,8 @@ static int preserve_domain(uint32_t *r_domid, libxl_event *event, > > static int freemem(uint32_t domid, libxl_domain_build_info *b_info) > { > - int rc, retries; > - const int MAX_RETRIES = 3; > - uint32_t need_memkb, free_memkb, free_memkb_prev = 0; > + int rc, retries = 3; > + uint32_t need_memkb, free_memkb; > > if (!autoballoon) > return 0; > @@ -2209,7 +2208,6 @@ static int freemem(uint32_t domid, libxl_domain_build_info *b_info) > if (rc < 0) > return rc; > > - retries = MAX_RETRIES; > do { > rc = libxl_get_free_memory(ctx, &free_memkb); > if (rc < 0) > @@ -2234,16 +2232,7 @@ static int freemem(uint32_t domid, libxl_domain_build_info *b_info) > if (rc < 0) > return rc; > > - /* > - * If the amount of free mem has increased on this iteration (i.e. > - * some progress has been made) then reset the retry counter. > - */ > - if (free_memkb > free_memkb_prev) { > - retries = MAX_RETRIES; > - free_memkb_prev = free_memkb; > - } else { > - retries--; > - } > + retries--; > } while (retries > 0); > > return ERROR_NOMEM; > -- > 1.7.10.4