-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
.\" Copyright (c) 2013 by Turbo Fredriksson <[email protected]>. All rights reserved. | ||
.\" Copyright (c) 2019 by Delphix. All rights reserved. | ||
.\" Copyright (c) 2019 Datto Inc. | ||
.\" Copyright (c) 2019 by George Melikov <[email protected]>. All rights reserved. | ||
.\" The contents of this file are subject to the terms of the Common Development | ||
.\" and Distribution License (the "License"). You may not use this file except | ||
.\" in compliance with the License. You can obtain a copy of the license at | ||
|
@@ -408,7 +409,7 @@ Default value: \fB16,777,216\fR (16MB) | |
.RS 12n | ||
If we are not searching forward (due to metaslab_df_max_search, | ||
metaslab_df_free_pct, or metaslab_df_alloc_threshold), this tunable controls | ||
what segment is used. If it is set, we will use the largest free segment. | ||
what segment is used. If it is set, we will use the largest free segment. | ||
If it is not set, we will use a segment of exactly the requested size (or | ||
larger). | ||
.sp | ||
|
@@ -3103,7 +3104,7 @@ Default value: \fB25\fR. | |
\fBzfs_sync_pass_dont_compress\fR (int) | ||
.ad | ||
.RS 12n | ||
Starting in this sync pass, we disable compression (including of metadata). | ||
Starting in this sync pass, we disable compression (including of metadata). | ||
With the default setting, in practice, we don't have this many sync passes, | ||
so this has no effect. | ||
.sp | ||
|
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, | ||
PAGESIZE); | ||
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