New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rbd: fix thread_offsets calculation of rbd bench #20590
Conversation
src/tools/rbd/action/Bench.cc
Outdated
if (off < (io_size * unit_len * io_threads) ) { | ||
thread_offset[i] += io_size; | ||
} else { | ||
// thread_offset is adjusted to the chunks unassgined to threads. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: unassigned
src/tools/rbd/action/Bench.cc
Outdated
thread_offset[i] = off + (i * io_size); | ||
} | ||
if (thread_offset[i] + io_size > size) | ||
thread_offset[i] = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: shouldn't this be something like thread_offset[i] = unit_len * i * io_size
Thank you for your comment. My explanation might be misleading, so I'll describe it more carefully with images. Benchmark should not overwrite chunks because the write performance of allocated chunks is different from unallocated chunks. When an unallocated chunk is written, ceph allocates new rados object; meanwhile, when an allocated chunk is written, no need to allocate new rados object. So, the benchmark is affected by the overheads of the operation. Thus, the benchmark needs to avoid to overwrite chunks allocated by previous write. These accesses are described below (assumption is same as PR message):
|
@hitoshikamei That wasn't what I was proposing -- what I was proposing was to stop all threads restarting at offset zero after the image is written once. |
This patch fixes the calculation of the thread_offset vector for sequential I/O of rbd bench command. The rbd bench command doesn't access whole image of rbd, because the some chunks are not assigned to threads. This patch changes the way to calculate the thread_offsets to assign all chunks to threads. Signed-off-by: Hitoshi Kamei <hitoshi.kamei.xm@hitachi.com> Cc: Mitsuo Hayasaka <mitsuo.hayasaka.hu@hitachi.com>
I'm sorry. I misunderstood your comment. You referred to line 313, not 310. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This patch fixes the way to calculate the thread_offset
vector for sequential I/O of rbd bench command.
The rbd bench command doesn't access whole image of rbd
in some cases, because the amount of accessed data is counted
up to the amount of total I/O.
For example, if options are set to below:
In this case, the data chunk is 5 (20MB / 4MB).
Fist, Thread 1 (T1) writes data to chunk 1. Thread 2 (T2)
writes data to chunk 2. Thread 3 (T3) writes data to
chunk 3. And, the amount of written data sums up to the "off"
value.
After that, the write position of each thread moves next
chunk, and threads overwrite data to the chunks. And,
the amount of overwritten data sums up to the "off" value.
Consequently, the off value reaches rbd image size, and
the rbd bench ends.
The rbd bench command doesn't write whole image, and 8 MB of
image is unwritten.
The processing image is described below:
Hitoshi Kamei (1):
rbd: fix thread_offsets calculation of rbd bench
src/tools/rbd/action/Bench.cc | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
--
2.15.1