[sheepdog] [PATCH 6/6] vditest: flush based on write counts

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Mon Feb 4 07:38:05 CET 2013


It doesn't make sense to flush after read requests.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 script/vditest |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/script/vditest b/script/vditest
index 50f92fc..d42d4ee 100755
--- a/script/vditest
+++ b/script/vditest
@@ -292,7 +292,6 @@ sub parse {
 sub vdi_main {
     my $roffset = $offset;
     my $woffset = $offset;
-    my $i = 1;
     my ($cur_time, $start_time, $end_time, $hbeat_time);
 
     $start_time = $cur_time = get_current_time();
@@ -308,8 +307,6 @@ sub vdi_main {
 	    wait_aio_requests();
 	}
 
-	print "$i: "  if $verbose;
-
 	if (rand($rrate + $wrate) < $rrate) {
 	    # read
 	    $length = $eblk - $roffset  if $roffset + $length > $eblk;
@@ -336,7 +333,7 @@ sub vdi_main {
 	    }
 	}
 
-	vdi_flush() if $flush_interval > 0 && $i % $flush_interval == 0;
+	vdi_flush() if $flush_interval > 0 && $wr_ops % $flush_interval == 0;
 
 	$cur_time = get_current_time();
 	if ($hbeat > 0 && $hbeat_time <= $cur_time) {
@@ -348,7 +345,6 @@ sub vdi_main {
 
 	    $hbeat_time += $hbeat * 1000000;
 	}
-	$i++;
     }
 
     print_result('Total read', $total_rd_bytes, $total_rd_ops, $runtime) if $rrate;
-- 
1.7.2.5




More information about the sheepdog mailing list