Skip to content

os/bluestore: refine in_flight check for KernelDevice - #35233

Closed
aclamk wants to merge 1 commit into
ceph:masterfrom
aclamk:wip-aclamk-monitor-kernel-device
Closed

aclamk wants to merge 1 commit into
ceph:masterfrom
aclamk:wip-aclamk-monitor-kernel-device

Conversation

@aclamk

@aclamk aclamk commented May 25, 2020

Copy link
Copy Markdown
Contributor

This change is to make overlap read/read still legal.
Overlaps read/write and write/write still cause asserts.

debug_inflight.erase(offset, length);
if (debug_inflight_write.intersects(offset, length))
debug_inflight_write.erase(offset, length);
if (debug_inflight_read.intersects(offset, length))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you might want to use "else if" here - no need to attempt removal from debug_inflight_read if debug_inflight_write had the range.

if (cct->_conf->bdev_debug_inflight_ios) {
std::lock_guard l(debug_lock);
debug_inflight.erase(offset, length);
if (debug_inflight_write.intersects(offset, length))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you might want to use lower_bound function to locate the range and then use resulting iterator to erase it - saving one lookup this way

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

well, this will need some modifications in interval_set to implement partial erase for iterator... Perhaps an overkill for this secondary debugging feature...

@aclamk

aclamk commented May 29, 2020

Copy link
Copy Markdown
Contributor Author

@ifed01 I posted it here for reference only; but do you think I should go with such improvement?

@ifed01

ifed01 commented May 29, 2020

Copy link
Copy Markdown
Contributor

@ifed01 I posted it here for reference only; but do you think I should go with such improvement?

hmm, I didn't expect reference patch without a desire to commit it ;)
Well - this is definitely a bug which makes the overlap detection feature useless. IMO it's better to either have it fixed or don't have at all. The current state will cause just wasting of time in future when one tries to use it...

@stale

stale Bot commented Jul 29, 2020

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@stale stale Bot added the stale label Jul 29, 2020
@aclamk aclamk closed this Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants