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
test/fio: extend fio objectstore plugin to better simulate OSD behavior #19101
Conversation
@cbodley - ping |
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.
looks good overall. it's great to be able to make jobs that are closer to actual osd workloads 👍
i worry a bit about the extra overhead in fio_ceph_os_queue()
in the form of the pglog mutex and the allocation of buffers and map/set nodes, but at least we only pay for those when the specific features are enabled
src/test/fio/fio_ceph_objectstore.cc
Outdated
assert(o->oi_attr_len_high > o->oi_attr_len_low); | ||
// fill with the garbage as we do not care of the actual content... | ||
attrset["_"] = buffer::create(o->oi_attr_len_low + | ||
rand() % (o->oi_attr_len_high - o->oi_attr_len_low)); |
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.
see new include/random.h
to replace the use of rand() % n
:
auto len = ceph::util::generate_random_number(o->oi_attr_len_low, o->oi_attr_len_high);
that should also work in the case where o->oi_attr_len_low == o->oi_attr_len_high
, so it could simplify a lot of this split logic
src/test/fio/fio_ceph_objectstore.cc
Outdated
if (o->oi_attr_len_low == o->oi_attr_len_high) { | ||
if (o->oi_attr_len_low) { | ||
// fill with the garbage as we do not care of the actual content... | ||
attrset["_"] = buffer::create(o->oi_attr_len_low); |
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.
consider preallocating a single buffer in the Job
that's big enough to fit all of these. that would avoid these extra buffer allocations for each io
src/test/fio/fio_ceph_objectstore.cc
Outdated
@@ -11,6 +11,7 @@ | |||
#include <memory> | |||
#include <system_error> | |||
#include <vector> | |||
#include <atomic> |
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.
unused?
src/test/fio/fio_ceph_objectstore.cc
Outdated
ObjectStore::Sequencer sequencer; | ||
// Can't use mutex directly in vectors hence dynamic allocation | ||
|
||
ceph::shared_ptr<std::mutex> lock; |
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.
std::unique_ptr
will also work here (vector
only requires it to be movable or copyable), and would save an extra allocation on construction
ed51272
to
4ff76a3
Compare
@cbodley - fixed |
Signed-off-by: Igor Fedotov <ifedotov@suse.com>
Signed-off-by: Igor Fedotov ifedotov@suse.com
4ff76a3
to
9d7291f
Compare
retest this please |
Signed-off-by: Igor Fedotov ifedotov@suse.com