All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Mike Latimer <mlatimer@suse.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	Wei Liu <wei.liu2@citrix.com>,
	xen-devel@lists.xen.org
Subject: Re: [PATCH] libxl: Wait for ballooning if free memory is increasing
Date: Wed, 28 Jan 2015 13:05:25 +0000	[thread overview]
Message-ID: <1422450325.14124.24.camel@citrix.com> (raw)
In-Reply-To: <1421904173-2941-1-git-send-email-mlatimer@suse.com>

On Wed, 2015-01-21 at 22:22 -0700, Mike Latimer wrote:

Sorry for the delay.

> @@ -2228,7 +2230,13 @@ static int freemem(uint32_t domid, libxl_domain_build_info *b_info)
>          if (rc < 0)
>              return rc;
>  
> -        retries--;
> +        /* only decrement retry count if free_memkb is not increasing */

This isn't quite true -- you also reset the retry count if progress has
been made.

> +        if (free_memkb <= free_memkb_prev) {
> +            retries--;

I think you need to update prev here, otherwise after one successful
iteration the condition is always true even if progress subsequently
stalls.

> +        } else {
> +            retries = MAX_RETRIES;
> +            free_memkb_prev = free_memkb;

... iow the second assignment here should be after the if/else entirely.

Given that this new loop can take significantly longer to fail I wonder
if we should add some progress logging? xl has an xtl logger instance
available so using xtl_progress might be an easy option. Maybe a
separate patch though.

Ian.

  parent reply	other threads:[~2015-01-28 13:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-22  5:22 [PATCH] libxl: Wait for ballooning if free memory is increasing Mike Latimer
2015-01-28  4:54 ` Mike Latimer
2015-01-28 11:28 ` Wei Liu
2015-01-28 13:05 ` Ian Campbell [this message]
2015-01-29  0:14   ` Mike Latimer
2015-01-29 10:14     ` Ian Campbell
2015-01-30 19:58       ` Mike Latimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1422450325.14124.24.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=Stefano.Stabellini@eu.citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=mlatimer@suse.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.