erasure-code: reduce jerasure verbosity

Only output a message about adjusting the buffer size when it is
adjusted, not when the size does not need adjustment.

Signed-off-by: Loic Dachary <loic@dachary.org>
erasure-code: cauchy techniques allow w 8,16,32

Enforce the restriction at initialization time, the same way it is done
for Reed Solomon. Choosing a w value different from 8,16,32 will lead to
memory corruption that cannot easily be traced to the cause.

Signed-off-by: Loic Dachary <loic@dachary.org>
erasure-code: align chunk sizes, not object size

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 Reed Solomon, it is enough for a chunk to be
a multiple of w * LARGEST_VECTOR_WORDSIZE.

The semantic of ErasureCodeJerasure::get_alignment returned a size
alignment constraint that had to be enforced as a multiple of the object
size. The resulting object size then had to fit the constraints above
after being divided by K, although the constraints have no relationship
with K. It led to excessive padding, making it impossible to set
sensible parameters for techniques derived Cauchy when the object size
was small.

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 sematic and the ErasureCodeJerasure::get_alignment methods are
re-implemented.

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

Signed-off-by: Loic Dachary <loic@dachary.org>
erasure-code: control jerasure plugin variant selection

The jerasure-variant parameter is interpreted as the name of the plugin
variant to be loaded regardless of the available CPU features. The
values can be sse3, sse4, generic. It is undocumented and meant for
benchmarking purposes, primarily to force the generic plugin to be
loaded when the sse4 would be chosen.

Signed-off-by: Loic Dachary <loic@dachary.org>
erasure-code: rework benchmark suite

Expand the default suite to enumerate all cases that are relevant to the
current code base so that it is easier to consume. Namely it means

 * iterating over object sizes of 4KB (what is used by default) and
   1MB (what was previous benchmarked)
 * grouping results in series that would make sense to plot to get the
   behavior of a given technique for a series of K/M values and all
   possible erasures.

Instead of specifying the iterations to run, set the size of the total
data set to be exercised and compute the iterations by dividing it by
the object size. Since the object size varies, it is impractical to
preset the number of iterations and get meaningful results.

The PARAMETERS environment variable is added to enable the caller to
inject --parameter jerasure-variant=generic, for instance.

The packets size is calculated based on the other parameters. The
options are limited when packets are small (4KB) and it would not make a
real difference to give control over it. The packet size is capped to
a maximum of 3100 bytes which is roughly what has been found to be an
optimal value for large packets (1MB).

Signed-off-by: Loic Dachary <loic@dachary.org>
erasure-code: HTML display of benchmark results

The ceph_erasure_code_benchmark output is converted into a JSON series
suitable to display in HTML with the http://www.flotcharts.org/
library. A self contained copy of the HTML,JS,CSS files is included for
durability and can be used from the source tree with:

  CEPH_ERASURE_CODE_BENCHMARK=src/ceph_erasure_code_benchmark  \
  PLUGIN_DIRECTORY=src/.libs \
      qa/workunits/erasure-code/bench.sh fplot jerasure |
      tee qa/workunits/erasure-code/bench.js

and display with:

  firefox qa/workunits/erasure-code/bench.html

Signed-off-by: Loic Dachary <loic@dachary.org>