-
Notifications
You must be signed in to change notification settings - Fork 593
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
c/self-test/diskcheck: Avoid large allocations #11173
Conversation
`diskcheck_opts::request_size` is provided by the user. To avoid very large allocations, split the request size into at most 128KiB chunks, and read/write them via an iovec. Preliminary testing shows very little difference in the performance. Fixes redpanda-data#10305 Signed-off-by: Ben Pope <ben@redpanda.com>
b4e2227
to
33313e9
Compare
iov.reserve(_opts.request_size / buf_len); | ||
for (size_t offset = 0; offset < _opts.request_size; offset += buf_len) { | ||
size_t len = std::min(_opts.request_size - offset, buf_len); | ||
iov.push_back(iovec{buf.get(), len}); |
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.
should we regenerate with new random data here? potentially to avoid making compression more effective?
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.
There's no compression option in self_test::diskcheck , so i think its cool
ping @graphcareful |
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 nice job posting how the change makes no huge negative impact on results
iov.reserve(_opts.request_size / buf_len); | ||
for (size_t offset = 0; offset < _opts.request_size; offset += buf_len) { | ||
size_t len = std::min(_opts.request_size - offset, buf_len); | ||
iov.push_back(iovec{buf.get(), len}); |
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.
There's no compression option in self_test::diskcheck , so i think its cool
/backport v23.1.x |
Thanks for this fix, @BenPope! |
diskcheck_opts::request_size
is provided by the user.To avoid very large allocations, split the request size into at most 128KiB chunks, and read/write them via an iovec.
Local testing with a single core:
Fixes #10305
Backports Required
Release Notes
Improvements