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

Re: [Xen-devel] Question about mapping hvmâs memory to dom0



On Jul 2, 2013, at 12:51 PM, George Dunlap <George.Dunlap@xxxxxxxxxxxxx> wrote:

> On Tue, Jul 2, 2013 at 3:26 PM, Kai Luo <kluo@xxxxxxxxxx> wrote:
>> 
>> 
>> 
>> 
>> ----- Original Message -----
>>> From: "George Dunlap" <dunlapg@xxxxxxxxx>
>>> To: "Kai Luo" <kluo@xxxxxxxxxx>
>>> Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, "Dietmar Hahn" 
>>> <dietmar.hahn@xxxxxxxxxxxxxx>
>>> Sent: Tuesday, July 2, 2013 9:43:27 PM
>>> Subject: Re: [Xen-devel] Question about mapping hvmâs memory to dom0
>>> 
>>> On Tue, Jul 2, 2013 at 2:31 PM, Kai Luo <kluo@xxxxxxxxxx> wrote:
>>>> 
>>>> I know every frame has a struct to help xen manage memory,in addition to
>>>> normal mapping,when the frame refcount increases for hvm domain?page
>>>> sharing?Or something else?
>>> 
>>> (Please don't top-post.)
>>> 
>>> I'm sorry, do you mean, "When does the frame refcount increase?"
>>> 
>>> I'm afraid it's a bit complicated and not written down anywhere.  In
>>> *general* the refcount increases whenever the page is mapped by a
>>> domain, including dom0; as long as it has dom0 has domU pages mapped,
>>> their reference counts will be at least 1 and the domain cannot be
>>> destroyed.
>> 
>>   Sorry about that top-post.I can think out circumstance that refcount 
>> increases which shows as below:(1)when the frame is assigned to a 
>> domain;(2)when the frame is mapped to dom0 by the given xc* interface.
>>   Without people's intervention,are there any other condition that refcount 
>> increasesïFor exampleïthe content in pages of different domains are sameïso 
>> they share only one frame and the refcount increases?
> 
> Page sharing is a fairly new feature, and I'm not exactly sure how
> refcounting works in that case.  Tim / Andres, care to comment?

Sharing uses the type count (which is separate from the page ref count). 
Without going into pedantic detail: if a page is shared by three domains, and 
mapped read-only by dom0, it will have shared type, three type references, and 
five page references (3 shared + 1 foreign map + 1 for allocation).

It is uncommon for type references to go beyond zero for an hvm domain's page, 
and it is uncommon for page references to go beyond one, outside of references 
grabbed by foreign maps. Sharing is one of the few cases where that changes.

Hopefully that example clears things out.

Andres

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