-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zio_compress: use spa_max_ashift as 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. So we can check only for sector size. Signed-off-by: George Melikov <[email protected]>
- Loading branch information
Showing
6 changed files
with
39 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ | |
* Copyright (c) 2017, Nexenta Systems, Inc. All rights reserved. | ||
* Copyright (c) 2019, loli10K <[email protected]>. All rights reserved. | ||
* Copyright (c) 2020, George Amanakis. All rights reserved. | ||
* Copyright (c) 2020 by George Melikov. All rights reserved. | ||
*/ | ||
|
||
/* | ||
|
@@ -1755,7 +1756,7 @@ arc_hdr_authenticate(arc_buf_hdr_t *hdr, spa_t *spa, uint64_t dsobj) | |
abd_take_ownership_of_buf(abd, B_TRUE); | ||
|
||
csize = zio_compress_data(HDR_GET_COMPRESS(hdr), | ||
hdr->b_l1hdr.b_pabd, tmpbuf, lsize); | ||
hdr->b_l1hdr.b_pabd, tmpbuf, lsize, 0); | ||
ASSERT3U(csize, <=, psize); | ||
abd_zero_off(abd, csize, psize - csize); | ||
} | ||
|
@@ -8531,7 +8532,8 @@ l2arc_apply_transforms(spa_t *spa, arc_buf_hdr_t *hdr, uint64_t asize, | |
cabd = abd_alloc_for_io(asize, ismd); | ||
tmp = abd_borrow_buf(cabd, asize); | ||
|
||
psize = zio_compress_data(compress, to_write, tmp, size); | ||
psize = zio_compress_data(compress, to_write, tmp, size, | ||
spa->spa_max_ashift); | ||
ASSERT3U(psize, <=, HDR_GET_PSIZE(hdr)); | ||
if (psize < asize) | ||
bzero((char *)tmp + psize, asize - psize); | ||
|
@@ -9901,7 +9903,7 @@ l2arc_log_blk_commit(l2arc_dev_t *dev, zio_t *pio, l2arc_write_callback_t *cb) | |
/* try to compress the buffer */ | ||
list_insert_tail(&cb->l2wcb_abd_list, abd_buf); | ||
psize = zio_compress_data(ZIO_COMPRESS_LZ4, | ||
abd_buf->abd, tmpbuf, sizeof (*lb)); | ||
abd_buf->abd, tmpbuf, sizeof (*lb), dev->l2ad_spa->spa_max_ashift); | ||
|
||
/* a log block is never entirely zero */ | ||
ASSERT(psize != 0); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters