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

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

To: Tristan Gingold <Tristan.Gingold@xxxxxxxx>
Subject: [Xen-ia64-devel] Re: PATCH: live migration
From: Alex Williamson <alex.williamson@xxxxxx>
Date: Tue, 25 Jul 2006 11:07:16 -0600
Cc: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 25 Jul 2006 10:07:50 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <200607251043.18973.Tristan.Gingold@xxxxxxxx>
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>
Organization: OSLO R&D
References: <200607251043.18973.Tristan.Gingold@xxxxxxxx>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
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

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