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

RE: [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


 


Rackspace

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