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
librbd: require exclusive lock for reads if pwl cache is enabled #43038
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jenkins test make check |
@idryomov . although make check faild, i wanted you can riew this. I'm not sure for this and it's a policy of exclusive-lock for cache. |
majianpeng
changed the title
librbd: Read request need exclusive-lock when enable pwl-cache.
[RFC]librbd: Read request need exclusive-lock when enable pwl-cache.
Sep 3, 2021
majianpeng
force-pushed
the
librbd-pwl-exclusive-lock
branch
from
September 4, 2021 01:43
2a2f315
to
cf3d88f
Compare
majianpeng
force-pushed
the
librbd-pwl-exclusive-lock
branch
2 times, most recently
from
September 4, 2021 02:37
9a92c6f
to
7aa8c8b
Compare
idryomov
reviewed
Sep 6, 2021
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.
Seems completely reasonable to me. Please remove the RFC tag and sort out the unittest.
majianpeng
changed the title
[RFC]librbd: Read request need exclusive-lock when enable pwl-cache.
librbd: Read request need exclusive-lock when enable pwl-cache.
Sep 7, 2021
majianpeng
force-pushed
the
librbd-pwl-exclusive-lock
branch
from
September 7, 2021 08:21
7aa8c8b
to
d9abf0e
Compare
trociny
approved these changes
Sep 7, 2021
trociny
reviewed
Sep 7, 2021
trociny
reviewed
Sep 7, 2021
TestLibRBD.TestFUA descript the following workload: a)write/read the same image w/ pwl-cache write_image = open(image_name); read_image = open(image_name); b)i/o workload is: write(write_image) write need EXLock and require EXLOCK read(read_image) in ExclusiveLock<I>::init(), firstly read need EXLOCK so will require EXLOCK. write_image release EXLOCK(will flush data to osd and remove cache). read_image init pwl-cache and read-io firstly enter pwl-cache and missed and then read from osd. write(write_image) write need EXLOCK and require EXLOCK. This make read_image remove empty cache. write_image init cache pool and write data to cache. read(read_image) In send_set_require_lock(), it set write need EXLOCK. So read don't require EXLOCK and dirtyly read from osd. Because second-read don't need EXLOCK and make write_image don't release EXLOCK(flush dirty data to osd and shutdown pwl-cache). This make second-read don't read the latest data. So we should make read also need EXLOCK when enable pwl-cache. Fixes: https://tracker.ceph.com/issues/51438 Tested-by: Feng Hualong <hualong.feng@intel.com> Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
majianpeng
force-pushed
the
librbd-pwl-exclusive-lock
branch
2 times, most recently
from
September 8, 2021 01:59
928f853
to
621facb
Compare
trociny
approved these changes
Sep 8, 2021
idryomov
changed the title
librbd: Read request need exclusive-lock when enable pwl-cache.
librbd: require exclusive lock for reads if pwl cache is enabled
Sep 10, 2021
idryomov
approved these changes
Sep 10, 2021
14 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TestLibRBD.TestFUA descript the following workload:
a)write/read the same image w/ pwl-cache
write_image = open(image_name);
read_image = open(image_name);
b)i/o workload is:
write(write_image)
write need EXLock and require EXLOCK
read(read_image)
in ExclusiveLock::init(), firstly read need EXLOCK
so will require EXLOCK. write_image release EXLOCK(will
flush data to osd and remove cache). read_image init pwl-cache
and read-io firstly enter pwl-cache and missed and then read
from osd.
write(write_image)
write need EXLOCK and require EXLOCK. This make read_image remove
empty cache. write_image init cache pool and write data to cache.
read(read_image)
In send_set_require_lock(), it set write need EXLOCK.
So read don't require EXLOCK and dirtyly read from osd.
Because second-read don't need EXLOCK and make write_image don't
release EXLOCK(flush dirty data to osd and shutdown pwl-cache).
This make second-read don't read the latest data.
So we should make read also need EXLOCK when enable pwl-cache.
Fixes: https://tracker.ceph.com/issues/51438
Tested-by: Feng Hualong hualong.feng@intel.com
Signed-off-by: Jianpeng Ma jianpeng.ma@intel.com
Checklist
Show available Jenkins commands
jenkins retest this please
jenkins test classic perf
jenkins test crimson perf
jenkins test signed
jenkins test make check
jenkins test make check arm64
jenkins test submodules
jenkins test dashboard
jenkins test dashboard cephadm
jenkins test api
jenkins test docs
jenkins render docs
jenkins test ceph-volume all
jenkins test ceph-volume tox