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

Re: [Xen-devel] [Patch] [libxc] add missing free in xc_finish_mmu_updates to avoid memory leak


  • To: Stephan Creutz <stephan.creutz@xxxxxxxxxxxxxxxxx>
  • From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
  • Date: Fri, 13 Apr 2007 15:42:36 +0100
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 13 Apr 2007 07:39:58 -0700
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: Acd92foOOHmKZunNEduH7gAWy6hiGQ==
  • Thread-topic: [Xen-devel] [Patch] [libxc] add missing free in xc_finish_mmu_updates to avoid memory leak

On 13/4/07 15:31, "Stephan Creutz" <stephan.creutz@xxxxxxxxxxxxxxxxx> wrote:

>> You could work around by stripping all pagetable-type pinning, then
>> make updates to all memory pages, then reapply pagetable-type pinning.
>> This would mean that your memory rollback code would not need to take
>> special account of pagetables.
> 
> That was my first approach to solve the problem, but it failed. As far
> as I understand it is not that easy because to unpin a frame its
> typecount have to be 0. What is the general approach to decrease the
> typecount to 0?

If you reset all VCPU states (setvcpucontext(NULL)) to clear all %cr3
references, and all pinnings are got rid of, then the type counts should
naturally fall to zero. One exception is linear pagetables (tables mapping
themselves) because these introduce circular references, which would need to
be handled somehow. Linux at least doesn't use linear page tables though.

I don't think you can avoid this type-count issue by the way. If you want to
do arbitrary rollback you have to be able to handle modifying the guest
state arbitrarily, including any kinds of updates to guest page types etc.
To me, that would suggest that just zapping all the existing metadata and
rebuilding from scratch is at least a good initial approach, which you might
then measure and improve upon.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.