All of lore.kernel.org
 help / color / mirror / Atom feed
* Question about mapping hvm‘s memory to dom0
       [not found] <183829454.13872961.1372645851829.JavaMail.root@vmware.com>
@ 2013-07-01  2:32 ` Kai Luo
  2013-07-01  5:37   ` Question about mapping hvmŒs " Keir Fraser
  2013-07-01  9:52   ` Question about mapping hvm‘s " George Dunlap
  0 siblings, 2 replies; 10+ messages in thread
From: Kai Luo @ 2013-07-01  2:32 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 626 bytes --]



Hi: 
I am trying to make some source code modifications to map the hvm memory to dom0,I use the xc_map_foreign_bulk to do this,It works and I export the hvm's memory to a file. My question is,after mapping the memory I use xc_domain_destroy to shutdown the running hvm,theoretically the mapped memory will be scrubbed because xen will scrubbed the hvm's memory before they are freed to xen hyperviser,however I export the mapped memory after destroying hvm,finding the content in mapped memory nearly same as formly exported,they are not scrubbed at all.That confused me.Can you give me any suggestion? 


Thank you 
Jone 


[-- Attachment #1.2: Type: text/html, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

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

* Re: Question about mapping hvmŒs  memory to dom0
  2013-07-01  2:32 ` Question about mapping hvm‘s memory to dom0 Kai Luo
@ 2013-07-01  5:37   ` Keir Fraser
  2013-07-01  5:58     ` Question about mapping hvmŒs " Kai Luo
  2013-07-01  9:52   ` Question about mapping hvm‘s " George Dunlap
  1 sibling, 1 reply; 10+ messages in thread
From: Keir Fraser @ 2013-07-01  5:37 UTC (permalink / raw)
  To: Kai Luo, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 945 bytes --]

The HVM domain is not destroyed while there are still external mappings of
its memory. 


On 01/07/2013 03:32, "Kai Luo" <kluo@vmware.com> wrote:

> Hi:
>          I am trying to make some source code modifications to map the hvm
> memory to dom0,I use the xc_map_foreign_bulk to do this,It works and I export
> the hvm's memory to a file. My question is,after mapping the memory I use
> xc_domain_destroy to shutdown the running hvm,theoretically the mapped memory
> will be scrubbed because xen will scrubbed the hvm's memory before they are
> freed to xen hyperviser,however I export the mapped memory after destroying
> hvm,finding the content in mapped memory nearly same as formly exported,they
> are not scrubbed at all.That confused me.Can you give me any suggestion?
> 
> Thank you
> Jone
> 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


[-- Attachment #1.2: Type: text/html, Size: 1725 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

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

* Re: Question about mapping hvmŒs memory to dom0
  2013-07-01  5:37   ` Question about mapping hvmŒs " Keir Fraser
@ 2013-07-01  5:58     ` Kai Luo
  0 siblings, 0 replies; 10+ messages in thread
From: Kai Luo @ 2013-07-01  5:58 UTC (permalink / raw)
  To: xen-devel, keir.xen


[-- Attachment #1.1: Type: text/plain, Size: 1569 bytes --]

Thank you Keir,I added some printk code in do_domctl() of domctl.c to check whether the xc_domain_destroy works,which gives the printk lines I added,so the domain_kill is also called after I map the hvm's memory.Do you mean after the domain destroyed, the memory is still held by hvm instead of returning to xen? 

----- Original Message -----

From: "Keir Fraser" <keir.xen@gmail.com> 
To: "Kai Luo" <kluo@vmware.com>, xen-devel@lists.xensource.com 
Sent: Monday, July 1, 2013 1:37:32 PM 
Subject: Re: [Xen-devel] Question about mapping hvmŒs memory to dom0 

Re: [Xen-devel] Question about mapping hvm‘s memory to dom0 The HVM domain is not destroyed while there are still external mappings of its memory. 


On 01/07/2013 03:32, "Kai Luo" < kluo@vmware.com > wrote: 



Hi: 
I am trying to make some source code modifications to map the hvm memory to dom0,I use the xc_map_foreign_bulk to do this,It works and I export the hvm's memory to a file. My question is,after mapping the memory I use xc_domain_destroy to shutdown the running hvm,theoretically the mapped memory will be scrubbed because xen will scrubbed the hvm's memory before they are freed to xen hyperviser,however I export the mapped memory after destroying hvm,finding the content in mapped memory nearly same as formly exported,they are not scrubbed at all.That confused me.Can you give me any suggestion? 

Thank you 
Jone 




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





[-- Attachment #1.2: Type: text/html, Size: 3299 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

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

* Re: Question about mapping hvm‘s memory to dom0
  2013-07-01  2:32 ` Question about mapping hvm‘s memory to dom0 Kai Luo
  2013-07-01  5:37   ` Question about mapping hvmŒs " Keir Fraser
@ 2013-07-01  9:52   ` George Dunlap
  2013-07-01 10:19     ` Dietmar Hahn
  1 sibling, 1 reply; 10+ messages in thread
From: George Dunlap @ 2013-07-01  9:52 UTC (permalink / raw)
  To: Kai Luo; +Cc: xen-devel

On Mon, Jul 1, 2013 at 3:32 AM, Kai Luo <kluo@vmware.com> wrote:
> Hi:
>         I am trying to make some source code modifications to map the hvm
> memory to dom0,I use the xc_map_foreign_bulk to do this,It works and I
> export the hvm's memory to a file. My question is,after mapping the memory I
> use xc_domain_destroy to shutdown the running hvm,theoretically the mapped
> memory will be scrubbed because xen will scrubbed the hvm's memory before
> they are freed to xen hyperviser,however I export the mapped memory after
> destroying hvm,finding the content in mapped memory nearly same as formly
> exported,they are not scrubbed at all.That confused me.Can you give me any
> suggestion?

Just let me clarify a bit: You're saying that you 1) map the guest
memory, 2) destroy the domain, 3) read the already-mapped memory
again?

If you keep the guest memory mapped by dom0 after you destroy the
domain, then the memory still has reference counts and isn't freed,
and thus won't be scrubbed.  (In fact, if you do "xl list", I bet
you'll find a "zombie domain" still left over which cant' shut down
because its pages aren't freed yet.)  When you unmap the pages in
dom0, they will then be freed, and since the domain is in the
"is_dying" state, they will be scrubbed.

The logic can be found in xen/common/page_alloc.c:free_domheap_pages().

 -George

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

* Re: Question about mapping hvm‘s memory to dom0
  2013-07-01  9:52   ` Question about mapping hvm‘s " George Dunlap
@ 2013-07-01 10:19     ` Dietmar Hahn
  2013-07-02 13:31       ` Kai Luo
  0 siblings, 1 reply; 10+ messages in thread
From: Dietmar Hahn @ 2013-07-01 10:19 UTC (permalink / raw)
  To: xen-devel; +Cc: George Dunlap, Kai Luo, xen-devel

Am Montag 01 Juli 2013, 10:52:45 schrieb George Dunlap:
> On Mon, Jul 1, 2013 at 3:32 AM, Kai Luo <kluo@vmware.com> wrote:
> > Hi:
> >         I am trying to make some source code modifications to map the hvm
> > memory to dom0,I use the xc_map_foreign_bulk to do this,It works and I
> > export the hvm's memory to a file. My question is,after mapping the memory I
> > use xc_domain_destroy to shutdown the running hvm,theoretically the mapped
> > memory will be scrubbed because xen will scrubbed the hvm's memory before
> > they are freed to xen hyperviser,however I export the mapped memory after
> > destroying hvm,finding the content in mapped memory nearly same as formly
> > exported,they are not scrubbed at all.That confused me.Can you give me any
> > suggestion?
> 
> Just let me clarify a bit: You're saying that you 1) map the guest
> memory, 2) destroy the domain, 3) read the already-mapped memory
> again?
> 
> If you keep the guest memory mapped by dom0 after you destroy the
> domain, then the memory still has reference counts and isn't freed,
> and thus won't be scrubbed.  (In fact, if you do "xl list", I bet
> you'll find a "zombie domain" still left over which cant' shut down
> because its pages aren't freed yet.)

Not sure if 'xl list' shows the dying domain. But you can see this via the
hypervisor console when pressing 'q'.

Dietmar.

> When you unmap the pages in
> dom0, they will then be freed, and since the domain is in the
> "is_dying" state, they will be scrubbed.
> 
> The logic can be found in xen/common/page_alloc.c:free_domheap_pages().
> 
>  -George
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 
-- 
Company details: http://ts.fujitsu.com/imprint.html

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

* Re: Question about mapping hvm‘s memory to dom0
  2013-07-01 10:19     ` Dietmar Hahn
@ 2013-07-02 13:31       ` Kai Luo
  2013-07-02 13:43         ` George Dunlap
  0 siblings, 1 reply; 10+ messages in thread
From: Kai Luo @ 2013-07-02 13:31 UTC (permalink / raw)
  To: xen-devel; +Cc: dietmar.hahn


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?
----- Original Message -----
From: "Dietmar Hahn" <dietmar.hahn@ts.fujitsu.com>
To: xen-devel@lists.xen.org
Cc: "George Dunlap" <George.Dunlap@eu.citrix.com>, "Kai Luo" <kluo@vmware.com>, xen-devel@lists.xensource.com
Sent: Monday, July 1, 2013 6:19:10 PM
Subject: Re: [Xen-devel] Question about mapping hvm‘s memory to dom0

Am Montag 01 Juli 2013, 10:52:45 schrieb George Dunlap:
> On Mon, Jul 1, 2013 at 3:32 AM, Kai Luo <kluo@vmware.com> wrote:
> > Hi:
> >         I am trying to make some source code modifications to map the hvm
> > memory to dom0,I use the xc_map_foreign_bulk to do this,It works and I
> > export the hvm's memory to a file. My question is,after mapping the memory I
> > use xc_domain_destroy to shutdown the running hvm,theoretically the mapped
> > memory will be scrubbed because xen will scrubbed the hvm's memory before
> > they are freed to xen hyperviser,however I export the mapped memory after
> > destroying hvm,finding the content in mapped memory nearly same as formly
> > exported,they are not scrubbed at all.That confused me.Can you give me any
> > suggestion?
> 
> Just let me clarify a bit: You're saying that you 1) map the guest
> memory, 2) destroy the domain, 3) read the already-mapped memory
> again?
> 
> If you keep the guest memory mapped by dom0 after you destroy the
> domain, then the memory still has reference counts and isn't freed,
> and thus won't be scrubbed.  (In fact, if you do "xl list", I bet
> you'll find a "zombie domain" still left over which cant' shut down
> because its pages aren't freed yet.)

Not sure if 'xl list' shows the dying domain. But you can see this via the
hypervisor console when pressing 'q'.

Dietmar.

> When you unmap the pages in
> dom0, they will then be freed, and since the domain is in the
> "is_dying" state, they will be scrubbed.
> 
> The logic can be found in xen/common/page_alloc.c:free_domheap_pages().
> 
>  -George
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 
-- 
Company details: http://ts.fujitsu.com/imprint.html

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

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

* Re: Question about mapping hvm‘s memory to dom0
  2013-07-02 13:31       ` Kai Luo
@ 2013-07-02 13:43         ` George Dunlap
  2013-07-02 14:26           ` Kai Luo
  0 siblings, 1 reply; 10+ messages in thread
From: George Dunlap @ 2013-07-02 13:43 UTC (permalink / raw)
  To: Kai Luo; +Cc: xen-devel, Dietmar Hahn

On Tue, Jul 2, 2013 at 2:31 PM, Kai Luo <kluo@vmware.com> 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.

 -George

> ----- Original Message -----
> From: "Dietmar Hahn" <dietmar.hahn@ts.fujitsu.com>
> To: xen-devel@lists.xen.org
> Cc: "George Dunlap" <George.Dunlap@eu.citrix.com>, "Kai Luo" <kluo@vmware.com>, xen-devel@lists.xensource.com
> Sent: Monday, July 1, 2013 6:19:10 PM
> Subject: Re: [Xen-devel] Question about mapping hvm‘s memory to dom0
>
> Am Montag 01 Juli 2013, 10:52:45 schrieb George Dunlap:
>> On Mon, Jul 1, 2013 at 3:32 AM, Kai Luo <kluo@vmware.com> wrote:
>> > Hi:
>> >         I am trying to make some source code modifications to map the hvm
>> > memory to dom0,I use the xc_map_foreign_bulk to do this,It works and I
>> > export the hvm's memory to a file. My question is,after mapping the memory I
>> > use xc_domain_destroy to shutdown the running hvm,theoretically the mapped
>> > memory will be scrubbed because xen will scrubbed the hvm's memory before
>> > they are freed to xen hyperviser,however I export the mapped memory after
>> > destroying hvm,finding the content in mapped memory nearly same as formly
>> > exported,they are not scrubbed at all.That confused me.Can you give me any
>> > suggestion?
>>
>> Just let me clarify a bit: You're saying that you 1) map the guest
>> memory, 2) destroy the domain, 3) read the already-mapped memory
>> again?
>>
>> If you keep the guest memory mapped by dom0 after you destroy the
>> domain, then the memory still has reference counts and isn't freed,
>> and thus won't be scrubbed.  (In fact, if you do "xl list", I bet
>> you'll find a "zombie domain" still left over which cant' shut down
>> because its pages aren't freed yet.)
>
> Not sure if 'xl list' shows the dying domain. But you can see this via the
> hypervisor console when pressing 'q'.
>
> Dietmar.
>
>> When you unmap the pages in
>> dom0, they will then be freed, and since the domain is in the
>> "is_dying" state, they will be scrubbed.
>>
>> The logic can be found in xen/common/page_alloc.c:free_domheap_pages().
>>
>>  -George
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>>
> --
> Company details: http://ts.fujitsu.com/imprint.html
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

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

* Re: Question about mapping hvm‘s memory to dom0
  2013-07-02 13:43         ` George Dunlap
@ 2013-07-02 14:26           ` Kai Luo
  2013-07-02 16:51             ` George Dunlap
  0 siblings, 1 reply; 10+ messages in thread
From: Kai Luo @ 2013-07-02 14:26 UTC (permalink / raw)
  To: xen-devel; +Cc: dunlapg





----- Original Message -----
> From: "George Dunlap" <dunlapg@umich.edu>
> To: "Kai Luo" <kluo@vmware.com>
> Cc: xen-devel@lists.xensource.com, "Dietmar Hahn" <dietmar.hahn@ts.fujitsu.com>
> 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@vmware.com> 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.
> 
>  -George
> 
> > ----- Original Message -----
> > From: "Dietmar Hahn" <dietmar.hahn@ts.fujitsu.com>
> > To: xen-devel@lists.xen.org
> > Cc: "George Dunlap" <George.Dunlap@eu.citrix.com>, "Kai Luo"
> > <kluo@vmware.com>, xen-devel@lists.xensource.com
> > Sent: Monday, July 1, 2013 6:19:10 PM
> > Subject: Re: [Xen-devel] Question about mapping hvm‘s memory to dom0
> >
> > Am Montag 01 Juli 2013, 10:52:45 schrieb George Dunlap:
> >> On Mon, Jul 1, 2013 at 3:32 AM, Kai Luo <kluo@vmware.com> wrote:
> >> > Hi:
> >> >         I am trying to make some source code modifications to map the
> >> >         hvm
> >> > memory to dom0,I use the xc_map_foreign_bulk to do this,It works and I
> >> > export the hvm's memory to a file. My question is,after mapping the
> >> > memory I
> >> > use xc_domain_destroy to shutdown the running hvm,theoretically the
> >> > mapped
> >> > memory will be scrubbed because xen will scrubbed the hvm's memory
> >> > before
> >> > they are freed to xen hyperviser,however I export the mapped memory
> >> > after
> >> > destroying hvm,finding the content in mapped memory nearly same as
> >> > formly
> >> > exported,they are not scrubbed at all.That confused me.Can you give me
> >> > any
> >> > suggestion?
> >>
> >> Just let me clarify a bit: You're saying that you 1) map the guest
> >> memory, 2) destroy the domain, 3) read the already-mapped memory
> >> again?
> >>
> >> If you keep the guest memory mapped by dom0 after you destroy the
> >> domain, then the memory still has reference counts and isn't freed,
> >> and thus won't be scrubbed.  (In fact, if you do "xl list", I bet
> >> you'll find a "zombie domain" still left over which cant' shut down
> >> because its pages aren't freed yet.)
> >
> > Not sure if 'xl list' shows the dying domain. But you can see this via the
> > hypervisor console when pressing 'q'.
> >
> > Dietmar.
> >
> >> When you unmap the pages in
> >> dom0, they will then be freed, and since the domain is in the
> >> "is_dying" state, they will be scrubbed.
> >>
> >> The logic can be found in xen/common/page_alloc.c:free_domheap_pages().
> >>
> >>  -George
> >>
> >> _______________________________________________
> >> Xen-devel mailing list
> >> Xen-devel@lists.xen.org
> >> http://lists.xen.org/xen-devel
> >>
> > --
> > Company details: http://ts.fujitsu.com/imprint.html
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org
> > http://lists.xen.org/xen-devel

   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?

Thank you
-Jone

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

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

* Re: Question about mapping hvm‘s memory to dom0
  2013-07-02 14:26           ` Kai Luo
@ 2013-07-02 16:51             ` George Dunlap
  2013-07-02 17:50               ` Andres Lagar-Cavilla
  0 siblings, 1 reply; 10+ messages in thread
From: George Dunlap @ 2013-07-02 16:51 UTC (permalink / raw)
  To: Kai Luo; +Cc: xen-devel, Tim Deegan, Andres Lagar-Cavilla

On Tue, Jul 2, 2013 at 3:26 PM, Kai Luo <kluo@vmware.com> wrote:
>
>
>
>
> ----- Original Message -----
>> From: "George Dunlap" <dunlapg@umich.edu>
>> To: "Kai Luo" <kluo@vmware.com>
>> Cc: xen-devel@lists.xensource.com, "Dietmar Hahn" <dietmar.hahn@ts.fujitsu.com>
>> 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@vmware.com> 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?

 -George

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

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

* Re: Question about mapping hvm‘s memory to dom0
  2013-07-02 16:51             ` George Dunlap
@ 2013-07-02 17:50               ` Andres Lagar-Cavilla
  0 siblings, 0 replies; 10+ messages in thread
From: Andres Lagar-Cavilla @ 2013-07-02 17:50 UTC (permalink / raw)
  To: George Dunlap; +Cc: Kai Luo, xen-devel, Tim Deegan, Andres Lagar-Cavilla


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

> On Tue, Jul 2, 2013 at 3:26 PM, Kai Luo <kluo@vmware.com> wrote:
>> 
>> 
>> 
>> 
>> ----- Original Message -----
>>> From: "George Dunlap" <dunlapg@umich.edu>
>>> To: "Kai Luo" <kluo@vmware.com>
>>> Cc: xen-devel@lists.xensource.com, "Dietmar Hahn" <dietmar.hahn@ts.fujitsu.com>
>>> 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@vmware.com> 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@lists.xen.org
http://lists.xen.org/xen-devel

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

end of thread, other threads:[~2013-07-02 17:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <183829454.13872961.1372645851829.JavaMail.root@vmware.com>
2013-07-01  2:32 ` Question about mapping hvm‘s memory to dom0 Kai Luo
2013-07-01  5:37   ` Question about mapping hvmŒs " Keir Fraser
2013-07-01  5:58     ` Question about mapping hvmŒs " Kai Luo
2013-07-01  9:52   ` Question about mapping hvm‘s " George Dunlap
2013-07-01 10:19     ` Dietmar Hahn
2013-07-02 13:31       ` Kai Luo
2013-07-02 13:43         ` George Dunlap
2013-07-02 14:26           ` Kai Luo
2013-07-02 16:51             ` George Dunlap
2013-07-02 17:50               ` Andres Lagar-Cavilla

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.