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

Re: [Xen-devel] Releasing physical memory allocated to a dying domain



On Tue, Nov 24, 2015 at 10:58 AM, Simula <mlodde@xxxxxxxxx> wrote:
> Hi everyone,
> Iâm looking at the code of domain_kill() to understand how a dying domain 
> releases its resources.
> If Iâm understanding correctly, physical memory is released by gradually 
> releasing the page tables and updating the page_info associated to each entry 
> to decrement reference counters until the page is finally scrubbed and 
> released as the counters reach 0. Is that correct?
> If so, why is memory released that way and not by simply walking d->page_list 
> and releasing pages as they appear in the list (assuming itâs not a shared 
> page still used by another domain)?

You've answered the question yourself. :-)  Xen can't scrub and
release a page until it knows the page is not being used by any other
domain; the only way to know that a page isn't being used is for its
reference count to go to zero.  Since we have to handle the case where
other domains are holding reference to pages at domain tear-down time
anyway, we might as well make the reference counting the primary way
of freeing memory.

 -George

_______________________________________________
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®.