[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 2/4] libxl_wait_for_memory_target: wait as long as dom0 is making progress



On Fri, Mar 06, 2015 at 05:19:15PM +0000, Stefano Stabellini wrote:
[...]
>  int libxl_wait_for_free_memory(libxl_ctx *ctx, uint32_t domid, uint32_t 
> memory_kb, int wait_secs);
> -/* wait for the memory target of a domain to be reached */
> +/* 
> + * Wait for the memory target of a domain to be reached. Does not
> + * decrement wait_secs if the domain is making progress toward reaching
> + * the target. If the domain is not making progress, wait_secs is
> + * decremented. If the timeout expires before the target is reached, the
> + * function returns ERROR_FAIL.
> + *
> + * Older versions of this function (Xen 4.5 and older), decremented
> + * wait_secs even if the domain was making progress, resulting in far
> + * lower overall wait times. To make sure that your calling routine
> + * works with new and old implementations of the function, pass enough
> + * time for the guest to reach its target as an argument.
> + */

Need to have a #define LIBXL_HAVE_$FOO to mark the change in behaviour,
so that client can cope with this change.

Wei.

>  int libxl_wait_for_memory_target(libxl_ctx *ctx, uint32_t domid, int 
> wait_secs);
>  
>  int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass);
> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index f4c4122..2dc7574 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -2226,8 +2226,8 @@ static int freemem(uint32_t domid, 
> libxl_domain_build_info *b_info)
>          else if (rc != ERROR_NOMEM)
>              return rc;
>  
> -        /* the memory target has been reached but the free memory is still
> -         * not enough: loop over again */
> +        /* wait until dom0 reaches its target, as long as we are making
> +         * progress */
>          rc = libxl_wait_for_memory_target(ctx, 0, 1);
>          if (rc < 0)
>              return rc;
> -- 
> 1.7.10.4

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.