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

[Xen-changelog] [xen-unstable] libxc: Remove permute() function from xc_

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxc: Remove permute() function from xc_domain_save().
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 20 Mar 2008 05:41:06 -0700
Delivery-date: Thu, 20 Mar 2008 05:45:42 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1205930508 0
# Node ID d1e91aba27584bbefd3650ac8e5174d63b8e5b33
# Parent  26a7a2d154e1a0f51da1fd44337091f3bcf39bf9
libxc: Remove permute() function from xc_domain_save().
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 tools/libxc/xc_domain_save.c |   28 +---------------------------
 1 files changed, 1 insertion(+), 27 deletions(-)

diff -r 26a7a2d154e1 -r d1e91aba2758 tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c      Wed Mar 19 10:33:13 2008 +0000
+++ b/tools/libxc/xc_domain_save.c      Wed Mar 19 12:41:48 2008 +0000
@@ -123,24 +123,6 @@ static inline int count_bits ( int nr, v
     for ( i = 0; i < (nr / (sizeof(unsigned long)*8)); i++, p++ )
         count += hweight32(*p);
     return count;
-}
-
-static inline int permute(unsigned long i, unsigned long order_nr)
-{
-    /* Need a simple permutation function so that we scan pages in a
-       pseudo random order, enabling us to get a better estimate of
-       the domain's page dirtying rate as we go (there are often
-       contiguous ranges of pfns that have similar behaviour, and we
-       want to mix them up. */
-  
-  unsigned char keep = 9; /* chunk of 2 MB */
-  unsigned char shift_low = (order_nr - keep) / 2 + ((order_nr - keep) / 2) % 
2;
-  unsigned char shift_high = order_nr - keep - shift_low;
-
-  unsigned long high = (i >> (keep + shift_low));
-  unsigned long low = (i >> keep) & ((1 << shift_low) - 1);
-
-  return (i & ((1 << keep) - 1)) | (low << (shift_high + keep)) | (high << 
keep);
 }
 
 static uint64_t tv_to_us(struct timeval *new)
@@ -847,9 +829,6 @@ int xc_domain_save(int xc_handle, int io
     /* base of the region in which domain memory is mapped */
     unsigned char *region_base = NULL;
 
-    /* power of 2 order of p2m_size */
-    int order_nr;
-
     /* bitmap of pages:
        - that should be sent this iteration (unless later marked as skip);
        - to skip this iteration because already dirty;
@@ -958,11 +937,6 @@ int xc_domain_save(int xc_handle, int io
 
     /* pretend we sent all the pages last iteration */
     sent_last_iter = p2m_size;
-
-    /* calculate the power of 2 order of p2m_size, e.g.
-       15->4 16->4 17->5 */
-    for ( i = p2m_size-1, order_nr = 0; i ; i >>= 1, order_nr++ )
-        continue;
 
     /* Setup to_send / to_fix and to_skip bitmaps */
     to_send = malloc(BITMAP_SIZE);
@@ -1114,7 +1088,7 @@ int xc_domain_save(int xc_handle, int io
                    (batch < MAX_BATCH_SIZE) && (N < p2m_size);
                    N++ )
             {
-                int n = permute(N, order_nr);
+                int n = N;
 
                 if ( debug )
                 {

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] libxc: Remove permute() function from xc_domain_save()., Xen patchbot-unstable <=