Open
Conversation
added 4 commits
December 8, 2014 16:41
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
Formerly known as "strong claim," this change introduces a new sharable() property to ceph::buffer::raw objects, which can be used to prevent unplanned sharing of buffers. The default value of sharable() is true, but derived classes may override this. For example, Accelio message buffers may point to registered or pool-allocated memory which should not be held for long periods. Cloning of non-sharable buffers is now the unmarked case, so is performed automatically in the buffer::list copy constructor. Low-level operations should allow explicit volatile sharing, so copying a buffer::list:iterator or a buffer::ptr works as normal. For explicit sharing of "non-sharable" buffers, a new boolean is added to the public claim_* methods, and a buffer::list::share method is also added, to share an entire sequence. Signed-off-by: Vu Pham <vu@mellanox.com> Signed-off-by: Matt Benjamin <matt@linuxbox.com> Signed-off-by: Matt Benjamin <matt@cohortfs.com> Conflicts: src/include/buffer.h Signed-off-by: Matt Benjamin <matt@cohortfs.com> Conflicts: src/common/buffer.cc Signed-off-by: Matt Benjamin <matt@cohortfs.com> new naming for "strong claim": clone_nonsharable Signed-off-by: Matt Benjamin <matt@cohortfs.com>
This change restores volatile sharing semantics in the Message decode path, and also in the OSD write path for FileStore/FileJournal. This can be verified with a breakpoint set at the clone/COW case in buffer::ptr::clone_nonsharable(currently buffer.cc:690). Signed-off-by: Matt Benjamin <matt@cohortfs.com>
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
This file contains hidden or 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
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.
The new "sharable" language still seems imperfect, but hopefully better than volatile. We can change it again if needed.