From: Igor Fedotov Date: Mon, 22 May 2017 15:19:25 +0000 (-0700) Subject: rbd/bench: fixes write gaps when doing sequential writes with io-threads > 1 X-Git-Tag: v12.1.1~65^2~24^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F15206%2Fhead;p=ceph.git rbd/bench: fixes write gaps when doing sequential writes with io-threads > 1 Signed-off-by: Igor Fedotov Signed-off-by: Mykola Golub mgolub@mirantis.com --- diff --git a/src/tools/rbd/action/Bench.cc b/src/tools/rbd/action/Bench.cc index d985922a7b19..365593cde7ff 100644 --- a/src/tools/rbd/action/Bench.cc +++ b/src/tools/rbd/action/Bench.cc @@ -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;