Skip to content

Conversation

@mattbenjamin
Copy link
Contributor

The new "sharable" language still seems imperfect, but hopefully better than volatile. We can change it again if needed.

Matt Benjamin added 4 commits December 8, 2014 16:41
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 <[email protected]>
Signed-off-by: Matt Benjamin <[email protected]>
Signed-off-by: Matt Benjamin <[email protected]>

Conflicts:
	src/include/buffer.h

Signed-off-by: Matt Benjamin <[email protected]>

Conflicts:
	src/common/buffer.cc

Signed-off-by: Matt Benjamin <[email protected]>

new naming for "strong claim": clone_nonsharable

Signed-off-by: Matt Benjamin <[email protected]>
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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants