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-devel

RE: [Xen-devel] How to deallocate memory shared between domain and xen

To: "Keir Fraser" <Keir.Fraser@xxxxxxxxxxxx>, "Santos, Jose Renato G" <joserenato.santos@xxxxxx>
Subject: RE: [Xen-devel] How to deallocate memory shared between domain and xen
From: "Ian Pratt" <m+Ian.Pratt@xxxxxxxxxxxx>
Date: Wed, 10 Aug 2005 10:44:28 +0100
Cc: Jose Renato Santos <jsantos@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 10 Aug 2005 09:42:42 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcWdiskffPz/ltqsQ6CajHf7wP/s3gAAusgQ
Thread-topic: [Xen-devel] How to deallocate memory shared between domain and xen
> >   This seems to be working fine.
> >   Now, I am not sure what is the sequence of operations to 
> deallocate 
> > these
> >   shared pages when they are not needed anymore. I spent sometime
> >   looking at the code but I still don't have a clear understanding
> >   of how memory is managed in Xen.
> >
> >   Any help is greatly appreciated, as will save me a lot of time ...
> 
> You want to be able to deallocate them before the domain you 
> were sharing with is destroyed? There are no existing 
> examples in Xen of how that would be done (things like 
> grant-table pages and shared_info page are all destroyed 
> after the domain dies).
> 
> Is this the kind of thing you are looking for?:
>   1. On allocaction: SHARE_PFN_WITH_DOMAIN(); get_page();
>   2. On deallocation: put_page()
> 
> ...and then the pages get freed up automatically when the 
> guest has freed all references. That is: the pages do not get 
> freed until you have given up your one reference (put_page) 
> and the guest has given up its references.
> 
> This can be added quite easily, but will require an new page flag.

We're talking about a pretty special situation here, and I'm not totally
sure its worth adding this to Xen, at least it requires disucssion.

Jose: as an interim measure, please can you knock up a version that just
deallocates when the domain dies. It would be very useful to get SMP
xen-oprofile working ASAP!

I would like to point out that I currently don't like the way oprofile
offers EIP samples to each domain for conversion into symbols. I'd much
rather see this done off-line. In my view, Xen should log the
domain,EIP,guest_pagetable,and kernel stack pointer in each sample,
storing it in a per-(physical)CPU buffer that's shared with the
monitoring domain (usually dom0). Dom0 will then be able to distinguish
different processes (by pagetable) and even different threads (by linux
kernel stack pointer) even if it won't actually by able to name them.

Comments? (Any how, don't let my views stop you from getting something
working quickly)

Ian

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel