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/BlueFS: optimize get_allocated #14121

Merged
merged 1 commit into from Apr 1, 2017

Conversation

Projects
None yet
2 participants
@majianpeng
Member

majianpeng commented Mar 24, 2017

Only update extents it interator all extents to get allocated,
especially for recycling-log-file.

Signed-off-by: Jianpeng Ma jianpeng.ma@intel.com

Because every change extents, we also need set recalc_alloc=true. This make code complex. But for every flush_range, we will call get_allocated(). especially for recycling-log-file, it don't change until alloc new extent.

@liewegas

This comment has been minimized.

Show comment
Hide comment
@liewegas

liewegas Mar 24, 2017

Member

I'm inclined to do something a bit more explicit. Instead of a flag, just add a uint64_t allocated field, and update it whenever we changed extents. Either setting it diretcly (e.g., extents.clear(); allocated = 0;) or by calling a recalc_allocated() helper that address them up, or adding a newly added extent to allocated directly.

It would actually be best to make extents and allocated private and update them safely via an accessor, but check how awkward that will be with the current users?

Member

liewegas commented Mar 24, 2017

I'm inclined to do something a bit more explicit. Instead of a flag, just add a uint64_t allocated field, and update it whenever we changed extents. Either setting it diretcly (e.g., extents.clear(); allocated = 0;) or by calling a recalc_allocated() helper that address them up, or adding a newly added extent to allocated directly.

It would actually be best to make extents and allocated private and update them safely via an accessor, but check how awkward that will be with the current users?

@liewegas liewegas changed the title from [RFC]optimize func get_allocated. to os/bluestore/BlueFS: optimize get_allocated. Mar 24, 2017

@liewegas liewegas changed the title from os/bluestore/BlueFS: optimize get_allocated. to os/bluestore/BlueFS: optimize get_allocated Mar 24, 2017

@liewegas liewegas added the needs-qa label Mar 27, 2017

@liewegas

This comment has been minimized.

Show comment
Hide comment
@liewegas

liewegas Mar 28, 2017

Member

retest this please

Member

liewegas commented Mar 28, 2017

retest this please

os/bluestore/bluefs_type: avoid interator all extents when call func …
…get_allocated.

Only update extents it interator all extents to get allocated,
especially for recycling-log-file.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
@majianpeng

This comment has been minimized.

Show comment
Hide comment
@majianpeng

majianpeng Mar 28, 2017

Member

Passed all test cases.

Member

majianpeng commented Mar 28, 2017

Passed all test cases.

@liewegas liewegas merged commit cc6a88e into ceph:master Apr 1, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details

@majianpeng majianpeng deleted the majianpeng:bluefs-get-allocated branch Apr 1, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment