]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
erasure-code: implement alignment on chunk sizes 1890/head
authorLoic Dachary <loic@dachary.org>
Tue, 27 May 2014 16:40:45 +0000 (18:40 +0200)
committerLoic Dachary <loic@dachary.org>
Mon, 4 Aug 2014 08:54:21 +0000 (10:54 +0200)
commitc7daaaf5e63d0bd1d444385e62611fe276f6ce29
treee716b05a5c991929c888c62747d95041877a813a
parent3987ac2a418870fb51411f21c98925518bf2cb01
erasure-code: implement alignment on chunk sizes

jerasure expects chunk sizes that are aligned on the largest possible
vector size that could be used by SSE instructions, when available (
LARGEST_VECTOR_WORDSIZE == 16 bytes ).

For techniques derived from Cauchy, encoding and decoding is done by
subdividing the chunk into packets of packetsize bytes. The operations
are done w * packetsize bytes at a time. It follows that each chunk must
have a size that is a multiple of w * packetsize bytes.

For techniques derived from Vandermonde, it is enough for a chunk to be
a multiple of w * LARGEST_VECTOR_WORDSIZE.

ErasureCodeJerasure::get_alignment returns a size alignment constraint
that has to be enforced as a multiple of the object size. The resulting
object size then has to match the chunk constraints described above
although they have no relationship with K. For Cauchy, it leads to
excessive padding, making it impossible to set sensible parameters for
when the object size is small.

When the per_chunk_alignement data member is true, the semantic of
ErasureCodeJerasure::get_alignment is changed to return a size alignment
constraint to be enforced as a multiple of the chunk size. The
ErasureCodeJerasure::get_chunk_size method is modified to use the new
semantic when appropriate.

The jerasure-per-chunk-alignement parameter is parsed to set
per_chunk_alignement for the Vandermonde and Cauchy techniques.

The memory address of a chunk is implicitly aligned to a page boundary
because it is allocated with buffer::create_page_aligned.

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

Signed-off-by: Loic Dachary <loic@dachary.org>
src/erasure-code/jerasure/ErasureCodeJerasure.cc
src/erasure-code/jerasure/ErasureCodeJerasure.h
src/test/erasure-code/TestErasureCodeJerasure.cc