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-ia64-devel

Re: [Xen-ia64-devel] Re: PATCH: live migration

To: Alex Williamson <alex.williamson@xxxxxx>
Subject: Re: [Xen-ia64-devel] Re: PATCH: live migration
From: Tristan Gingold <Tristan.Gingold@xxxxxxxx>
Date: Wed, 26 Jul 2006 08:13:40 +0200
Cc: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 25 Jul 2006 23:09:25 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1153847236.5603.28.camel@lappy>
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
References: <200607251043.18973.Tristan.Gingold@xxxxxxxx> <1153847236.5603.28.camel@lappy>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.5
Le Mardi 25 Juillet 2006 19:07, Alex Williamson a écrit :
> On Tue, 2006-07-25 at 10:43 +0200, Tristan Gingold wrote:
> > +static int xc_ia64_shadow_control(int xc_handle,
> > +                                  uint32_t domid,
> > +                                  unsigned int sop,
> > +                                  unsigned long *dirty_bitmap,
> > +                                  unsigned long pages,
> > +                                  xc_shadow_control_stats_t *stats)
> > +{
> > +    if (dirty_bitmap != NULL) {
> > +        int i;
> > +
> > +        /* Touch the page so that it is in the TC.
> > +           FIXME: improve this!!! */
> > +        for (i = 0; i < pages / 8; i += PAGE_SIZE)
> > +            dirty_bitmap[i / sizeof (unsigned long)] = 0;
> > +        dirty_bitmap[pages / BITS_PER_LONG] = 0;
> > +    }
>
> Hi Tristan,
>
>    Ok, I think I understand this now, but it still seems hard to follow.
> What about something like this:
>
> ---
> unsigned char *bmap = (unsigned char *)dirty_bitmap;
> unsigned long bmap_bytes = ((pages + BITS_PER_LONG - 1) & ~(BITS_PER_LONG -
> 1)) / 8; unsigned int bmap_pages = ((bmap_bytes + PAGE_SIZE - 1) &
> ~(PAGE_SIZE - 1)) / PAGE_SIZE;
>
> for (i = 0 ; i < bmap_pages ; i++)
>     bmap[i * PAGE_SIZE] = 0;
Ok.
But the last byte has still to be touched:
Suppose the bitmap is 1 PAGE_SIZE long, ie bmap_pages is 1.
Suppose dirty_bitmap is allocated accross two physical page (possible because 
malloc'ed).
The for loop will only touch the first physical page!

> ---
>
> It's still a little scary that we're relying on touching memory for it
> to have a TC entry.  I guess I can live with that for now.  Thanks,
I am too.
Contraty to xc_ia64_get_pfn_list which can restart, xc_shadow_control can't be 
restarted.  Therefore if the TC is flushed, the live migration failed.  
Fortunatly the whole process can be restarted: the domain does not crash.

In my opinion the best method is to use guest pseudo physical address instead 
of virtual address.  The logic would be more complex (the virtual to physical 
conversion has to be done in Linux) but much more reliable.
I have to look on ppc sources.

Tristan.

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

<Prev in Thread] Current Thread [Next in Thread>