All of lore.kernel.org
 help / color / mirror / Atom feed
* Releasing physical memory allocated to a dying domain
@ 2015-11-24 10:58 Simula
  2015-11-24 11:34 ` Jan Beulich
  2015-11-24 11:38 ` George Dunlap
  0 siblings, 2 replies; 3+ messages in thread
From: Simula @ 2015-11-24 10:58 UTC (permalink / raw)
  To: xen-devel

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)?

Best regards,
Mario

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Releasing physical memory allocated to a dying domain
  2015-11-24 10:58 Releasing physical memory allocated to a dying domain Simula
@ 2015-11-24 11:34 ` Jan Beulich
  2015-11-24 11:38 ` George Dunlap
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2015-11-24 11:34 UTC (permalink / raw)
  To: Simula; +Cc: xen-devel

>>> On 24.11.15 at 11:58, <mlodde@simula.no> wrote:
> 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)?

That parenthesized remark of yours actually answers your question:
How would a list walker know whether a page is still in use elsewhere?

Jan

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Releasing physical memory allocated to a dying domain
  2015-11-24 10:58 Releasing physical memory allocated to a dying domain Simula
  2015-11-24 11:34 ` Jan Beulich
@ 2015-11-24 11:38 ` George Dunlap
  1 sibling, 0 replies; 3+ messages in thread
From: George Dunlap @ 2015-11-24 11:38 UTC (permalink / raw)
  To: Simula; +Cc: xen-devel

On Tue, Nov 24, 2015 at 10:58 AM, Simula <mlodde@simula.no> 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@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-24 11:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-24 10:58 Releasing physical memory allocated to a dying domain Simula
2015-11-24 11:34 ` Jan Beulich
2015-11-24 11:38 ` George Dunlap

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.