]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rbd/bench: fixes write gaps when doing sequential writes with io-threads > 1
authorIgor Fedotov <ifedotov@mirantis.com>
Mon, 22 May 2017 15:19:25 +0000 (08:19 -0700)
committerIgor Fedotov <ifedotov@mirantis.com>
Tue, 23 May 2017 13:27:30 +0000 (06:27 -0700)
Signed-off-by: Igor Fedotov <ifedotov@mirantis.com>
Signed-off-by: Mykola Golub mgolub@mirantis.com
src/tools/rbd/action/Bench.cc

index d985922a7b193ce6bd1e037fbcceede271011012..365593cde7ffa93d94ce20136640f8393c08a213 100644 (file)
@@ -254,6 +254,9 @@ int do_bench(librbd::Image& image, io_type_t io_type,
     b.wait_for(io_threads - 1);
     i = 0;
     while (i < io_threads && off < io_bytes) {
+      if (!b.start_io(io_threads, thread_offset[i], io_size, op_flags)) {
+        break;
+      }
       if (random) {
         thread_offset[i] = (rand() % (size / io_size)) * io_size;
       } else {
@@ -261,10 +264,6 @@ int do_bench(librbd::Image& image, io_type_t io_type,
         if (thread_offset[i] + io_size > size)
           thread_offset[i] = 0;
       }
-
-      if (!b.start_io(io_threads, thread_offset[i], io_size, op_flags))
-        break;
-
       ++i;
       ++ios;
       off += io_size;