WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [Patch] [libxc] add missing free in xc_finish_mmu_update

To: "Keir Fraser" <Keir.Fraser@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [Patch] [libxc] add missing free in xc_finish_mmu_updates to avoid memory leak
From: Stephan Creutz <stephan.creutz@xxxxxxxxxxxxxxxxx>
Date: Sun, 8 Apr 2007 14:14:36 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Sun, 08 Apr 2007 05:13:38 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C23E5DF5.5896%keir@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20070407160329.6cdad542.stephan.creutz@xxxxxxxxxxxxxxxxx> <C23E5DF5.5896%keir@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Sun, 8 Apr 2007 00:53:09 -0700
"Keir Fraser" <Keir.Fraser@xxxxxxxxxxxxx> wrote:

> On 7/4/07 15:03, "Stephan Creutz" <stephan.creutz@xxxxxxxxxxxxxxxxx>
> wrote:
> 
> >> The only user of this interface calls free() on that memory itself.
> >It > also calls finish_mmu_update() more than once on the same mmu
> >> structure, so freeing it in finish_mmu_update() would not work.
> >> Probably best we rename xc_init_mmu_updates() to
> >> xc_alloc_mmu_updates(), finish_mmu_update to flush_mmu_updates(),
> >and > document the need for explicit free() in the header file. I'll
> >do > this.
> > 
> > Oops, overlooked that, but xc_finish_mmu_updates sounded like a
> > destructor. The new function names you propose and the comment
> > should clear things up. But I would disagree to make the whole
> > interface private (read that in the staging changelog) because
> > otherwise I will have to duplicate the code for a program I'm
> > working on (see my post recently before). On the other hand it would
> > be a minimal effort to recode that for my needs.
> 
> What do you need it for? It's not all that useful to the toolstack any
> more.

I'm trying to develop a fast rollback for domains without recreating
the whole domain. In some cases I need to update pagetables to restore
an older memory state from a checkpoint. Maybe I should integrate it in
libxc itself to avoid code duplication. But I thought it would be better
to start with an external tool because my rollback is very special. It
uses the shadow pagetables all the time to track dirty pages.
Shadow pagetables are slow, so it might not be useful for other users.

Stephan

Attachment: pgpmalLvbgJkv.pgp
Description: PGP signature

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