Skip to content
Permalink
Browse files

zio_compress: remove compressratio threshold

Now default compression is lz4, which can stop
compression process by itself on incompressible data.
If there is additional size checks -
we will only make our compressratio worse.

Signed-off-by: George Melikov <mail@gmelikov.ru>
  • Loading branch information...
gmelikov committed Sep 11, 2019
1 parent f454251 commit 347dcb26923e68c889c8b76ccca96453f300ef87
Showing with 2 additions and 8 deletions.
  1. +2 −8 module/zfs/zio_compress.c
@@ -39,11 +39,6 @@
*/
unsigned long zio_decompress_fail_fraction = 0;

/*
* Common disk sector size.
*/
short COMMON_SECTOR_SIZE = 4096;

/*
* Compression vectors.
*/
@@ -121,15 +116,14 @@ zio_compress_data(enum zio_compress c, abd_t *src, void *dst, size_t s_len)
if (c == ZIO_COMPRESS_EMPTY)
return (s_len);

/* Don't compress if it's less than common sector size */
d_len = MAX(0, s_len - COMMON_SECTOR_SIZE);
/* Don't threshold compressratio */
d_len = s_len;

/* No compression algorithms can read from ABDs directly */
void *tmp = abd_borrow_buf_copy(src, s_len);
c_len = ci->ci_compress(tmp, dst, s_len, d_len, ci->ci_level);
abd_return_buf(src, tmp, s_len);

/* block with recordsize <= COMMON_SECTOR_SIZE will always be raw */
if (c_len > d_len)
return (s_len);

0 comments on commit 347dcb2

Please sign in to comment.
You can’t perform that action at this time.