debuggers.hg
changeset 17288:d1e91aba2758
libxc: Remove permute() function from xc_domain_save().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Wed Mar 19 12:41:48 2008 +0000 (2008-03-19) |
parents | 26a7a2d154e1 |
children | f45aa9a14db4 |
files | tools/libxc/xc_domain_save.c |
line diff
1.1 --- a/tools/libxc/xc_domain_save.c Wed Mar 19 10:33:13 2008 +0000 1.2 +++ b/tools/libxc/xc_domain_save.c Wed Mar 19 12:41:48 2008 +0000 1.3 @@ -125,24 +125,6 @@ static inline int count_bits ( int nr, v 1.4 return count; 1.5 } 1.6 1.7 -static inline int permute(unsigned long i, unsigned long order_nr) 1.8 -{ 1.9 - /* Need a simple permutation function so that we scan pages in a 1.10 - pseudo random order, enabling us to get a better estimate of 1.11 - the domain's page dirtying rate as we go (there are often 1.12 - contiguous ranges of pfns that have similar behaviour, and we 1.13 - want to mix them up. */ 1.14 - 1.15 - unsigned char keep = 9; /* chunk of 2 MB */ 1.16 - unsigned char shift_low = (order_nr - keep) / 2 + ((order_nr - keep) / 2) % 2; 1.17 - unsigned char shift_high = order_nr - keep - shift_low; 1.18 - 1.19 - unsigned long high = (i >> (keep + shift_low)); 1.20 - unsigned long low = (i >> keep) & ((1 << shift_low) - 1); 1.21 - 1.22 - return (i & ((1 << keep) - 1)) | (low << (shift_high + keep)) | (high << keep); 1.23 -} 1.24 - 1.25 static uint64_t tv_to_us(struct timeval *new) 1.26 { 1.27 return (new->tv_sec * 1000000) + new->tv_usec; 1.28 @@ -847,9 +829,6 @@ int xc_domain_save(int xc_handle, int io 1.29 /* base of the region in which domain memory is mapped */ 1.30 unsigned char *region_base = NULL; 1.31 1.32 - /* power of 2 order of p2m_size */ 1.33 - int order_nr; 1.34 - 1.35 /* bitmap of pages: 1.36 - that should be sent this iteration (unless later marked as skip); 1.37 - to skip this iteration because already dirty; 1.38 @@ -959,11 +938,6 @@ int xc_domain_save(int xc_handle, int io 1.39 /* pretend we sent all the pages last iteration */ 1.40 sent_last_iter = p2m_size; 1.41 1.42 - /* calculate the power of 2 order of p2m_size, e.g. 1.43 - 15->4 16->4 17->5 */ 1.44 - for ( i = p2m_size-1, order_nr = 0; i ; i >>= 1, order_nr++ ) 1.45 - continue; 1.46 - 1.47 /* Setup to_send / to_fix and to_skip bitmaps */ 1.48 to_send = malloc(BITMAP_SIZE); 1.49 to_fix = calloc(1, BITMAP_SIZE); 1.50 @@ -1114,7 +1088,7 @@ int xc_domain_save(int xc_handle, int io 1.51 (batch < MAX_BATCH_SIZE) && (N < p2m_size); 1.52 N++ ) 1.53 { 1.54 - int n = permute(N, order_nr); 1.55 + int n = N; 1.56 1.57 if ( debug ) 1.58 {