Skip to content
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

erasure-code: enforce chunk size alignment (giant) #3083

Merged
3 commits merged into from Feb 10, 2015
Merged

erasure-code: enforce chunk size alignment (giant) #3083

3 commits merged into from Feb 10, 2015

Conversation

ghost
Copy link

@ghost ghost commented Dec 4, 2014

No description provided.

Do not assume the alignment is a power of two in the is_n_align_sized()
predicate. When used in the context of erasure code it is common
for chunks to not be powers of two.

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 73ad2d6)
Let say the ErasureCode::encode function is given a 4096 bytes
bufferlist made of a 1249 bytes bufferptr followed by a 2847 bytes
bufferptr, both properly starting on SIMD_ALIGN address. As a result the
second 2048 had to be reallocated when bufferlist::substr_of gets the
second 2048 buffer, the address starts at 799 bytes after the beginning
of the 2847 buffer ptr and is not SIMD_ALIGN'ed.

The ErasureCode::encode must enforce a size alignment based on the chunk
size in addition to the memory alignment required by SIMD operations,
using the bufferlist::rebuild_aligned_size_and_memory function instead of
bufferlist::rebuild_aligned.

http://tracker.ceph.com/issues/10211 Fixes: #10211

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 4e955f4)
The function bufferlist::rebuild_aligned checks memory and size
alignment with the same variable. It is however useful to separate
memory alignment constraints from size alignment constraints. For
instance rebuild_aligned could be called to allocate an erasure coded
buffer where each 2048 bytes chunk needs to start on a memory address
aligned on 32 bytes.

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 9ade88e)
@ghost ghost added bug-fix core labels Dec 4, 2014
@ghost ghost added this to the giant milestone Dec 4, 2014
@ghost ghost assigned athanatos Dec 4, 2014
@ghost ghost added the needs-qa label Dec 4, 2014
@loic-bot
Copy link

SUCCESS: make check on 99b6486 output is http://paste.ubuntu.com/9528744/

:octocat: Sent from GH.

@ghost ghost removed the needs-qa label Feb 1, 2015
ghost pushed a commit that referenced this pull request Feb 10, 2015
…lignement-giant

erasure-code: enforce chunk size alignment (giant)
@ghost ghost merged commit 1d77591 into ceph:giant Feb 10, 2015
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants