erasure-code: refactor jerasure Liberation parameters checks

Create a virtual function to check for each parameter for Liberation
and its derivations Liber8tion and BlaumRoth. The code is moved around
but is unmodified.

A function reseting the parameters to sane defaults when an error
occurs is introduced. It is slightly different from the code that was
duplicated in Liberation and BlaumRoth. In both cases it now resets w.
It is a noop for Liber8tion because the user cannot modify this
parameter which is always set to the default.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
erasure-code: fix BlaumRoth sanity check on w

For the BlaumRoth technique, w+1 must be a prime. This sanity check is
present in the sample code from the jerasure library but was not
implemented in the jerasure plugin.

The default value for w is also changed to match this constraint. The
unit tests is changed to always use the default w instead of forcing it
to w.

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

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
buffer: In rebuild_page_aligned for the last ptr is page aligned, no need call rebuild().

This only happen for the last ptr. Because rebuild() don't change the len
of ptr, so if last ptr isn't page-size aligned but is page aligned, the
rebuild() don't change anything.

Signed-off-by: Ma Jianpeng <jianpeng.ma@intel.com>
buffer: Add a test for bufferlist::rebuild_page_aligned

Make the last prt of bufferlist which is page-aligned don't change anything
after rebuild_page_aligned.

Signed-off-by: Ma Jianpeng <jianpeng.ma@intel.com>
client: fix a message leak

Signed-off-by: John Spray <john.spray@redhat.com>
mds: update segment references during journal rewrite

... to avoid leaving log events that reference log
segments by offsets which no longer exist.

Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit 386f2d7c829422695a1b1f41bd3f17ca3eef1f61)
Reviewed-by: Greg Farnum <greg@inktank.com>
Merge pull request #2477 from ceph/wip-client-msg-leak

client: fix a message leak
Merge pull request #2467 from majianpeng/fix3

buffer: In rebuild_page_aligned for the last ptr is page aligned, no need call rebuild().

Reviewed-by: Loic Dachary <loic-201408@dachary.org>
doc: fixes a formatting error on ops/crush-map

Signed-off-by: Stephen Jahl <stephenjahl@gmail.com>
Merge pull request #2481 from sjahl/master

doc: fixes a formatting error on ops/crush-map
Merge remote-tracking branch 'gh/giant'
doc: Added bucket management commands to ops/crush-map

Describes the CLI for adding and removing buckets, in addition to the
'moving' instructions which were already present.

Signed-off-by: Stephen Jahl <stephenjahl@gmail.com>
Merge pull request #2484 from sjahl/master

doc: Added bucket management commands to ops/crush-map

Reviewed-by: Loic Dachary <loic-201408@dachary.org>
doc: osd_backfill_scan_(min|max) are object counts

osd_backfill_scan_min and osd_backfill_scan_max set the number of
items grabbed during a single backfill scan, not an interval in
seconds. Correct the doc.

Signed-off-by: Dan van der Ster <daniel.vanderster@cern.ch>
Merge pull request #2488 from cernceph/docfix

doc: osd_backfill_scan_(min|max) are object counts

Reviewed-by: Loic Dachary <loic-201408@dachary.org>
Merge pull request #2442 from dachary/wip-6754-jerasure-parameters

erasure-code: fix BlaumRoth sanity check on w

Reviewed-by: Andreas Peters <andreas.joachim.peters@cern.ch>
bugfix: wrong socket address in log msg of Pipe.cc

paddr was not yet set up for the socket address

Signed-off-by: Yongyue Sun abioy.sun@gmail.com
Merge pull request #2485 from Abioy/master

bugfix: wrong socket address in log msg of Pipe.cc

Reviewed-by: Loic Dachary <loic-201408@dachary.org>
buffer: add an aligned buffer with less alignment than a page

SIMD optimized erasure code computation needs aligned memory. Buffers
aligned to a page boundary are wasted on it though. The buffers used
for the erasure code computation are typical smaller than a page.

Currently an alignement of 16 bytes is enough for the used
SIMD instruction sets (SSE4 and NEON).

Signed-off-by: Janne Grunau <j@jannau.net>
ec: make use of added aligned buffers

Requiring page aligned buffers and realigning the input if necessary
creates measurable oberhead. ceph_erasure_code_benchmark is ~30% faster
with this change for technique=reed_sol_van,k=2,m=1.

Also prevents a misaligned buffer when bufferlist::c_str(bufferlist)
has to allocate a new buffer to provide continuous one. See bug #9408

Signed-off-by: Janne Grunau <j@jannau.net>