Skip to contentSkip to conversation

What actually destroys a domain?

DISCUSSION Jimi Xenidis 3 participants 9 messages Sep 12, 2006 – Sep 13, 2006

lore
Share & tools
lore
#0 lore raw

Collegues say that x86 does not have this problem, however on PowerPC if you:
1) start a domain
2) attach console
3) destroy the domain

The xenconsole client stays connected because xenconsoled does not close the PTY. A character on the client will kick the close and all is well. Xenconsoled _does_ get the watch event, but the domain is completely destroyed and xc_domain_getinfo does not find it to eventually close() the PTY

It is possible that PowerPC is missing a get_domain(), perhpas by a resource held by xenconsoled?
Any thoughts?
-JX

#1 lore raw

Xenconsoled's mapping of the console page should keep the domain alive.

-- Keir

Quoted 21 lines · Jimi Xenidis

Collegues say that x86 does not have this problem, however on PowerPC if you:
1) start a domain
2) attach console
3) destroy the domain

The xenconsole client stays connected because xenconsoled does not close the PTY. A character on the client will kick the close and all is well. Xenconsoled _does_ get the watch event, but the domain is completely destroyed and xc_domain_getinfo does not find it to eventually close() the PTY

It is possible that PowerPC is missing a get_domain(), perhpas by a resource held by xenconsoled?
Any thoughts?
-JX

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw
Quoted 3 lines · Keir Fraser

Xenconsoled's mapping of the console page should keep the domain alive.

hmm, I'm having trouble associating the "mapping" and a refcount of some sort somewhere, any pointers?

-JX

#3 lore raw
Quoted 7 lines · Jimi Xenidis
Quoted 3 lines · Keir Fraser

Xenconsoled's mapping of the console page should keep the domain alive.

hmm, I'm having trouble associating the "mapping" and a refcount of some sort somewhere, any pointers?

I see it now, its in the "foreign domain" logic. I thought it would be a page count not a dom count. -JX

#4 lore raw
Quoted 6 lines · Jimi Xenidis
Quoted 4 lines · Jimi Xenidis
Quoted 1 line · Keir Fraser
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Xenconsoled's mapping of the console page should keep the domain alive.

hmm, I'm having trouble associating the "mapping" and a refcount of some sort somewhere, any pointers?

I see it now, its in the "foreign domain" logic. I thought it would be a page count not a dom count.

Actually, why *isn't* it increasing the page reference count? That would keep the page attached to the domain, which would mean d->tot_pages would stay non-zero, so that would indicate that the domain isn't ready to be killed yet...

Signature · 2 lines
Hollis Blanchard
IBM Linux Technology Center
#5 lore raw
In reply to Jimi Xenidis
Quoted 6 lines · Jimi Xenidis
Quoted 4 lines

Xenconsoled's mapping of the console page should keep the domain alive.

hmm, I'm having trouble associating the "mapping" and a refcount of some sort somewhere, any pointers?

See share_xen_page_with_guest() in arch/x86/mm.c. The refcnt is dropped when xenheap_pages field reduces to zero in common/page_alloc.c:free_domheap_pages().

-- Keir

#6 lore raw
Quoted 10 lines · Keir Fraser
Quoted 6 lines
Quoted 4 lines

Xenconsoled's mapping of the console page should keep the domain alive.

hmm, I'm having trouble associating the "mapping" and a refcount of some sort somewhere, any pointers?

See share_xen_page_with_guest() in arch/x86/mm.c. The refcnt is dropped when xenheap_pages field reduces to zero in common/page_alloc.c:free_domheap_pages().

Sorry, I'm talking rubbish here. As you say, the relevant code is actually in the foreign mapping paths (e.g., in arch/x86/mm.c). Those paths do a get_page() on the foreign page. This stops it being removed from the domU page list. A non-empty page list holds a reference on the domU. So the domU will not die until that foreign mapping is destroyed.

-- Keir

#7 lore raw
Quoted 16 lines · Keir Fraser
Quoted 10 lines · Keir Fraser
Quoted 6 lines
Quoted 4 lines

Xenconsoled's mapping of the console page should keep the domain alive.

hmm, I'm having trouble associating the "mapping" and a refcount of some sort somewhere, any pointers?

See share_xen_page_with_guest() in arch/x86/mm.c. The refcnt is dropped when xenheap_pages field reduces to zero in common/page_alloc.c:free_domheap_pages().

Quoted 5 lines

Sorry, I'm talking rubbish here. As you say, the relevant code is actually in the foreign mapping paths (e.g., in arch/x86/mm.c). Those paths do a get_page() on the foreign page. This stops it being removed from the domU page list. A non-empty page list holds a reference on the domU. So the domU will not die until that foreign mapping is destroyed.

Whew!

-JX

#8 lore raw
In reply to Keir Fraser
Quoted 9 lines · Keir Fraser
Quoted 4 lines · Jimi Xenidis
Quoted 4 lines

Xenconsoled's mapping of the console page should keep the domain alive.

Quoted 6 lines
Quoted 2 lines

hmm, I'm having trouble associating the "mapping" and a refcount of some sort somewhere, any pointers?

See share_xen_page_with_guest() in arch/x86/mm.c. The refcnt is dropped when xenheap_pages field reduces to zero in common/page_alloc.c:free_domheap_pages().

Hmm.. but the console page is a "domain page", no?
After looking at more code I convinced myself that a page not owned by the domain but owned by another is "foreign".

-JX