WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

RE: [Xen-API] [PATCH 3 of 4] [XIU]: when a domain target is updated, tra

To: "xen-api@xxxxxxxxxxxxxxxxxxx" <xen-api@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-API] [PATCH 3 of 4] [XIU]: when a domain target is updated, transfer the memory immediately from the host, respecting both the domain's max_mem and the total amount of memory free on the host
From: Dave Scott <Dave.Scott@xxxxxxxxxxxxx>
Date: Wed, 25 Nov 2009 10:26:32 +0000
Accept-language: en-US
Acceptlanguage: en-US
Delivery-date: Wed, 25 Nov 2009 02:26:32 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <3c4e4f66208468379b92.1259087680@xxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1259087677@xxxxxxxxxxxxxxxxxxxx> <3c4e4f66208468379b92.1259087680@xxxxxxxxxxxxxxxxxxxx>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcptNGx2BQ3TVNQyTg6K/5DFh+gr+AAhRxog
Thread-topic: [Xen-API] [PATCH 3 of 4] [XIU]: when a domain target is updated, transfer the memory immediately from the host, respecting both the domain's max_mem and the total amount of memory free on the host
Reviewing my own patch: 

> diff -r 25cea9ab5619 -r 3c4e4f662084 ocaml/xiu/xiu.ml
> --- a/ocaml/xiu/xiu.ml        Tue Nov 24 18:24:59 2009 +0000
> +++ b/ocaml/xiu/xiu.ml        Tue Nov 24 18:25:00 2009 +0000
> @@ -152,14 +152,31 @@
>       try Hashtbl.find domains domid
>       with Not_found -> raise Domain_not_found
> 
> +let round_down_to_page x = (x / 4) * 4
> +
> +(** Add up to [delta_kib] memory to the domain, reducing the host free
> +memory by the same amount *) let transfer_to_domain dom delta_kib =
> +  let available_kib = min !physical_free_kib delta_kib in
> +  eprintf "(XIU) transfer_to_domain domid = %d; delta_kib = %d\n%!"
> +dom.domid delta_kib;
> +  dom.tot_mem_kib <- dom.tot_mem_kib + available_kib;
> +  physical_free_kib := !physical_free_kib - available_kib
> +

We obviously need a mutex to protect 'physical_free_kib' since xiu is actually 
multithreaded (one thread per simulated domain)

Cheers,
Dave


_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api