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

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



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;
---

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,

        Alex

-- 
Alex Williamson                             HP Open Source & Linux Org.


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


 


Rackspace

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