diff --git a/test_swap.c b/test_swap.c index 7d650c2..581fd3a 100644 --- a/test_swap.c +++ b/test_swap.c @@ -36,15 +36,14 @@ int main() /* fill data */ for (i = 0; i < SIZE / 8; i += 8) - *(p + i) = (unsigned long)rand() << 32 | rand(); + *(p + i) = 0xffff + i; /* trigger pageout and get time of pageout */ gettimeofday(&tv_b, NULL); madvise(p, SIZE, MADV_PAGEOUT); gettimeofday(&tv_e, NULL); - printf("swp out bandwidth: %ld bytes/ms\n", - SIZE/(tv_to_ms(tv_e) - tv_to_ms(tv_b))); + printf("swp out bandwidth: %ld bytes/ms\n", SIZE/(tv_to_ms(tv_e) - tv_to_ms(tv_b))); /* read to trigger swapin and */ gettimeofday(&tv_b, NULL); @@ -52,8 +51,7 @@ int main() *(c + i) = i; gettimeofday(&tv_e, NULL); - printf("swp in bandwidth: %ld bytes/ms\n", - SIZE/(tv_to_ms(tv_e) - tv_to_ms(tv_b))); + printf("swp in bandwidth: %ld bytes/ms\n", SIZE/(tv_to_ms(tv_e) - tv_to_ms(tv_b))); pid = fork();