Commit Graph

82 Commits

Author SHA1 Message Date
Kefu Chai
75baa10d19
Merge pull request #18888 from tchaikov/wip-osx
common,test,cmake: various changes to re-enable build on osx

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Willem Jan Withagen <wjw@digiware.nl>
Reviewed-by: Casey Bodley <cbodley@redhat.com>
2017-11-14 15:02:33 +08:00
Sage Weil
ad66461dc0 compressor/zstd: use compress_generic from compression, cleanup
This is based on Yann Collet's changes (but somewhat adapted).

Signed-off-by: Sage Weil <sage@redhat.com>
2017-11-12 20:00:16 -06:00
Sage Weil
e9c0f05323 compressor/zstd: fix build options
Among other things, pass -O3, so that it goes faster.

Huge thank you to Yann Collet for identifying this as a build issue!

Signed-off-by: Sage Weil <sage@redhat.com>
2017-11-12 09:54:13 -06:00
Kefu Chai
033c408a60 cmake: should add snappy header dir for libceph_snappy
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-11-11 11:25:56 +08:00
Stefan Priebe
61107200a5 compressor/zstd: improvements
- static linking #define to get the advanced stuff
- hint src size to compressor
- no flush needed before end
- check for error

It's about twice as 25% faster now for 16KB chunks.

Note that a quick test to use resetCStream and reusing the same stream
did not appear to have any effect.

Signed-off-by: Sage Weil <sage@redhat.com>
2017-11-10 10:43:30 -06:00
Adam C. Emerson
8d4a07f89f build: Mark dependency includes as SYSTEM
It is not really our business to debug python, boost, or our other
dependencies. Mark them as system includes.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2017-11-03 23:58:41 -04:00
Danny Al-Gaaf
f24a0289ef LZ4Compressor.h: fix usage of unsigned var
Fix for:

[src/compressor/lz4/LZ4Compressor.h:49]: (style) Checking if
 unsigned variable 'compressed_len' is less than zero.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2017-10-25 18:14:05 +02:00
Haomai Wang
0ce27b9f6b compressor: kill AsyncCompressor which is broken
Signed-off-by: Haomai Wang <haomai@xsky.com>
2017-10-23 16:55:23 +08:00
Casey Bodley
acc6960040 compressor: use generate_random_number for type="random"
use an existing thread-local random engine instead of constructing,
seeding, and locking a separate engine

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2017-10-12 13:30:16 -04:00
Kefu Chai
629ad1986d cmake: disable plugins using isa-l on osx
clang on osx emits functions with leading underscore, but the isa-l
assembly's functions have no leading underscore. we could label the
function declaration like `int foo asm("foo")` to remove the leading
underscore, but isa-l is a git submodule, let do this later. and in the
meanwhile, disable this plugin on osx.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-09-16 10:43:32 +08:00
Sage Weil
3682651105 Merge pull request #15816 from chardan/jfw-wip-consolidate-spinlocks
common: consolidate spinlocks

Reviewed-by: Adam Emerson <aemerson@redhat.com>
2017-09-01 16:28:03 -05:00
Kefu Chai
b5ea349c0d compressor: conditionalize on HAVE_LZ4
do not enable lz4 compressor plugin unless HAVE_LZ4 is ON. so, for
example, when the compressor type is "random", the compressor factory
won't complain with:

load failed dlopen(): "/usr/lib64/ceph/compressor/libceph_lz4.so: cannot
open shared object file: No such file or directory"

anymore.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-08-17 15:12:25 +08:00
Jesse Williamson
a529605b71 compressor: migrate ceph::Spinlock to ceph::spinlock
Signed-off-by: Jesse Williamson <jwilliamson@suse.de>
2017-08-11 14:03:10 -07:00
Sage Weil
5bc9f6dafe compressor: accept 'none' or '' for none
This makes the parse and output methods match up.

Signed-off-by: Sage Weil <sage@redhat.com>
2017-07-27 22:30:12 -04:00
Casey Bodley
ec188a9dad zlib: remove g_ceph_context/g_conf from compressor plugin
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2017-07-10 13:20:08 -04:00
Ganesh Mahalingam
15c338b8c0 Update isa-l to v2.18
This upgrade brings
-  Complete rewrite of DEFLATE optimizations resulting in 5X better
   throughput and compression ratios comapred to  zlib, lz4, lzo and 2X
   better decompression performance when compared to zlib.
-  AVX512 improvements to multi-buffer versions of MD5, SHA-1 and SHA-256
   cryptographic hashing functions resulting in 3X better in performance
   compared to the AVX2 generation.

This update improves bluestore compression and potential to improve
dedup performance.

Testing this patch with objectstore fio yeided a max of 37% increase in
compression performance.

Fio Params:
rw=randwrite,buffer_compress_percentage=50,nr_files=64,direct=1,buffered=0,size=4G,bs=64k

Test			Avg BlueStore Compression Time
			v2.16(us)  v2.18(us)
iodepth=1,jobs=1	241.658    175.476	27.39%
iodepth=2,jobs=2	184.174    145.861	20.80%
iodepth=4,jobs=4	143.617    104.392	27.31%
iodepth=8,jobs=8	146.984    116.505	20.74%
iodepth=16,jobs=8	180.167    112.769	37.41%

Signed-off-by: Ganesh Mahalingam <ganesh.mahalingam@intel.com>
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
2017-07-06 14:42:47 -07:00
Kefu Chai
28c8373734 msg,common: do not include assert.h everywhere to clobber <assert.h>
* reverts c93daaf92b
* add "#include "include/assert.h" to where <cassert> or <assert.h> are
  included, or avoid including them if possible.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-06-08 11:46:26 +08:00
Sage Weil
b34507fbf1 Merge pull request #15434 from yuyuyu101/wip-lz4
compressor: add LZ4 support

Reviewed-by: Sage Weil <sage@redhat.com>
2017-06-07 09:07:45 -05:00
Haomai Wang
a97a6e8274 compressor: add LZ4 support
Signed-off-by: Haomai Wang <haomai@xsky.com>
2017-06-03 15:56:05 +08:00
Jesse Williamson
7b874e11ad compressor: migrate atomic_t to <atomic>
compare_exchange_strong() is used because on architectures without CaS instructions,
compare_exchange_weak() may fail.

Signed-off-by: Jesse Williamson <jwilliamson@suse.de>
2017-05-28 08:48:15 -07:00
shawn
2980b112cd compressor: optimize header file dependency
Signed-off-by: Xiaowei Chen <chen.xiaowei@h3c.com>
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
2017-05-20 12:10:02 +10:00
Dan Mick
84e47f3e82 compressor/zlib: fix plugin for non-Intel arches
unittest_compressor was failing on arm64 because the zlib
compressor was never initialized, even though it works fine in
non-isal mode

Signed-off-by: Dan Mick <dan.mick@redhat.com>
2017-05-03 20:17:32 -07:00
Kefu Chai
e5a8d89d1c cmake: pass compiler and linker down to zstd
so it can respect the setting specfied by user.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-05-01 15:49:59 +08:00
Kefu Chai
7f2ac2334a crc32c,compressor: only compile functions on supported arch
so we can still compile if certain header file (<sys/auxv.h>) used
for detecting cpu capabilities on ppc is missing on x86 host machine.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-04-04 11:38:29 +08:00
hechuang
7da62dc235 compressor: fix Mutex::Locker used is not correct
Signed-off-by: hechuang <hechuang@xsky.com>
2017-03-13 15:34:34 +08:00
liuchang0812
288924338a common: add override in header file
Signed-off-by: liuchang0812 <liuchang0812@gmail.com>
2017-03-03 19:21:44 +08:00
Bassam Tabbara
b957a518f3 compressor/zstd: add zstd to embedded ceph
Signed-off-by: Bassam Tabbara <bassam.tabbara@quantum.com>
2017-01-27 12:42:28 -08:00
Sage Weil
4dd38b923b compressor/zstd: add zstd compressor
Build/link of zstd itself is maybe not ideal, but it works fine.

Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-01-26 00:37:23 +08:00
Ricardo Dias
235448879e
cmake: fix rpath on shared libraries and executables
The problem was due to the attempt of CMake to rewrite the RPATH of
the executables, or shared libraries, that didn't have any RPATH linked
during the building phase.

Currently INSTALL_RPATH is already set for all binaries. This patch
sets an empty INSTALL_RPATH for all binaries that don't depend on
any internal (also being built) target.

Signed-off-by: Ricardo Dias <rdias@suse.com>
2017-01-18 12:40:41 +00:00
Kefu Chai
7ac89f3725 cmake: s/snappy/${SNAPPY_LIBRARIES}/
also s/z/${ZLIB_LIBARIES}/

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-01-10 21:10:53 +08:00
Kefu Chai
8f7643792c cmake: turn libcommon into a shared library
prior to this change, libcommon is a convenient library which gets
linked into librados, librbd and libcephfs and all ceph executables.
this incurs some problems:
 - double dose of libcommon in memory space and HDD: waste of memory
   and disk space.
 - if an application links to two libraries including libcommon at the
   same time. take librados and libcephfs as an example, they could
   interfere with each other by changing the other guy's status.
after this change, libcommon is tuned into a shared library and
renamed to libceph-common. it will be installed into $prefix/lib/ceph,
and packaged in librados2.

ceph.spec.in,debian/librados2.install: package libceph-common in
  librados2.
CMakeLists.txt:
  - do not link against libboost-* if not necessary.
  - s/common/ceph-common/g
  - install libceph-common into $prefix/lib/ceph
  - set rpath to $prefix/lib/ceph
  - link against ceph-common if an executable needs access to non public
    symbols in ceph.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-01-10 21:10:53 +08:00
John Spray
a7b0b1f37d Merge pull request #12276 from kylinstorage/wip-cleanup-makeshared
cleanup: use std::make_shared to replace new

Reviewed-by: John Spray <john.spray@redhat.com>
2017-01-06 13:11:03 +00:00
Adam C. Emerson
b9182564c7 dout: Use dout_context
As a transition for g_ceph_context removal, make all dout macros depends
on a local macro.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2016-12-22 13:55:37 -05:00
Yunchuan Wen
ba7250c601 compressor: use std::make_shared to replace new
Signed-off-by: Yunchuan Wen <yunchuan.wen@kylin-cloud.com>
2016-12-09 13:45:33 +08:00
Bassam Tabbara
b5d57c97c7 embedded: add compression and EC plugins to libcephd
Compression and erasure coding plugins are now statically compiled
into libcephd. A new method is added to load them into the
respective registry.

The static libraries are only built when WITH_EMBEDDED is enabled
and existing plugins are unaffected.

Signed-off-by: Bassam Tabbara <bassam.tabbara@quantum.com>
2016-11-28 23:48:02 -08:00
Sage Weil
61fca96c29 assert(0) -> ceph_abort()
Signed-off-by: Sage Weil <sage@redhat.com>
2016-11-21 23:37:31 -05:00
Adam C. Emerson
9ad32939e8 compress: Fix compilation failure from missing header
Compress was failing due to the random header not being included.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2016-11-21 12:34:23 -05:00
Casey Bodley
e1de56791e compressor: add support for type=random for teuthology testing
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2016-11-11 14:06:47 -05:00
Adam Kupczyk
262f6683c0 Fixed problem with snappy compressor when data size <=3.
Signed-off-by: Adam Kupczyk <akupczyk@mirantis.com>
2016-11-02 12:13:06 +01:00
Igor Fedotov
24dff2b6b0 os/bluestore: share compression/csum enums and corresponding stuff for common use
Signed-off-by: Igor Fedotov <ifedotov@mirantis.com>
2016-10-19 14:33:29 +00:00
Igor Fedotov
f331597fba common/compressor/ZLibCompressor: add a config option to specify compression level
Signed-off-by: Igor Fedotov <ifedotov@mirantis.com>
2016-10-14 13:44:47 +00:00
Igor Fedotov
b9953a1e20 compressor/ZLibCompressor: fix broken isal-l
Signed-off-by: Igor Fedotov <ifedotov@mirantis.com>
2016-10-12 13:38:26 +00:00
Sage Weil
c3d78f03ee compressor/zlib: add compressor_zlib_isal config option to disable ISA-L
We dynamically enable this if the necessary processor features are present.
Allow this probing to be disabled explicitly.

Signed-off-by: Sage Weil <sage@redhat.com>
2016-10-06 15:36:08 -04:00
Sage Weil
06ae3da85f compressor/snappy: fix decompress buffer sizing for large buffers
4 bytes is enough for small buffers, but fails for larger buffers because
snappy encodes the length as a varint.  8 is enough.

Signed-off-by: Sage Weil <sage@redhat.com>
2016-10-06 15:36:07 -04:00
Bassam Tabbara
10d06eb115 cmake: normalize use of SIMD flags
Signed-off-by: Bassam Tabbara <bassam.tabbara@quantum.com>
2016-09-29 10:34:33 -07:00
Sage Weil
31b9ff0f69 Merge pull request #11122 from branch-predictor/bp-zlib-improvements
compressor/zlib: switch to raw deflate

Reviewed-by: Sage Weil <sage@redhat.com>
2016-09-21 14:48:21 -05:00
Piotr Dałek
9bb433503f compressor/zlib: switch to raw deflate
By using raw deflate instead of default zlib deflate, we're
saving 6 bytes on each compression stream and some CPU time
by not calculating Adler32 during both compression and
decompression (which is waste of time as Bluestore has its
own checksumming code that is *also* executed).

Signed-off-by: Piotr Dałek <git@predictor.org.pl>
2016-09-18 00:10:40 +02:00
Igor Fedotov
0599b09cb1 common/compressor: add libcommonas a sependency for zlib and snappy plugins to ensure PluginRegistry access for them
Signed-off-by: Igor Fedotov <ifedotov@mirantis.com>
2016-09-14 16:15:29 +00:00
Igor Fedotov
d113f0d4bc compressor/zlis: improve buffer allocation to avoid space waste
Signed-off-by: Igor Fedotov <ifedotov@mirantis.com>
2016-09-14 12:48:36 +00:00
Igor Fedotov
d7b04ca9f1 common/compressor: fix improper length value passed to zlib compressor
Signed-off-by: Igor Fedotov <ifedotovo@miranitis.com>
2016-09-14 12:25:10 +00:00