|
|
|
|
|
|
|
|
|
|
xen-ia64-devel
Re: [Xen-ia64-devel] Re: PATCH: live migration
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
|
|
|
|
|