Skip to content
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

os/bluestore: allocate entire write in one go #17698

Merged
merged 1 commit into from Sep 16, 2017

Conversation

liewegas
Copy link
Member

On the first pass through the writes, compress data and calculate a final
amount of space we need to allocate. On the second pass, assign the
extents to blobs and queue the writes.

This allows us to do a single allocation for all blobs, which will lead
to less fragmentation and a much better write pattern.

Signed-off-by: Sage Weil sage@redhat.com

On the first pass through the writes, compress data and calculate a final
amount of space we need to allocate.  On the second pass, assign the
extents to blobs and queue the writes.

This allows us to do a single allocation for all blobs, which will lead
to less fragmentation and a much better write pattern.

Signed-off-by: Sage Weil <sage@redhat.com>
txc->statfs_delta.allocated() += got;
int64_t left = final_length;
while (left > 0) {
assert(prealloc_left > 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert(prealloc_pos != prealloc.end()); ? Otherwise we are at risk of access violation.

@xiexingguo
Copy link
Member

lgtm and good patch!

@liewegas liewegas merged commit cdd9a0b into ceph:master Sep 16, 2017
@liewegas liewegas deleted the wip-bluestore-big-allocations branch September 16, 2017 02:48
@xiexingguo
Copy link
Member

I think this deserves to be backported to luminous: #18033

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants