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

Re: [Xen-devel] page refcount on pages mapped by the toolstack..



>>> On 06.12.12 at 02:41, Mukesh Rathor <mukesh.rathor@xxxxxxxxxx> wrote:
> Hi,
> 
> I observed something that doesn't seem right to me:
> 
> PV dom0 booting PV guest (say domid 1). (no PVH).
> 
> xl cr vm.cfg.pv
> 
> Take some mfn from domid 1. It's refcnt is 1 as expected. Now, the lib
> wants to map it via xen_remap_domain_mfn_range(). The call goes thru
> do_mmu_update(), and upon returning the refcnt is 2, as expected.
> 
> Now, I noticed the refcnt doesn't go back to 1 after the guest is 
> created/booted. I'd have expected the process exit somewhere to have
> resulted in the refcnt going down to 1 (which is what would happen in case
> of PVH dom0).
> 
> The guest is up, I notice the refcnt is 2. I shutdown the guest, the
> refcnt goes to 0 and the page is freed via relinquish_memory() called
> from domain_relinquish_resources(). I would have expected the page
> to hang with refcnt 1, what if the user process still has it mapped?
> 
> What am I missing?

Did you perhaps not monitor the changes to the refcnt closely
enough? It ought to be 2 when the guest is up (on reference for
the _PGC_allocated bit, and another for it to be mapped
somewhere in the guest). I.e. between Dom0 creating the guest
(and touching its memory) and the guest actually starting, there
could be further adjustments to the refcnt that simply sum up to
zero.

Jan


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