Pack our DDT ZAPs a bit denser.

The DDT is really inefficient on 4k and up vdevs, because it always
allocates 4k blocks, and while compression could save us somewhat
at ashift 9, that stops being true.

So let's change the default to 32 KiB, which seems like a reasonable
compromise between improved space savings and inflated write sizes
for DDT updates.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes #14654
This commit is contained in:
Rich Ercolani 2023-06-30 12:42:02 -04:00 committed by GitHub
parent 61ab05cac7
commit 2b10e32561
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 3 deletions

View File

@ -239,6 +239,16 @@ relative to the pool.
Make some blocks above a certain size be gang blocks. Make some blocks above a certain size be gang blocks.
This option is used by the test suite to facilitate testing. This option is used by the test suite to facilitate testing.
. .
.It Sy zfs_ddt_zap_default_bs Ns = Ns Sy 15 Po 32 KiB Pc Pq int
Default DDT ZAP data block size as a power of 2. Note that changing this after
creating a DDT on the pool will not affect existing DDTs, only newly created
ones.
.
.It Sy zfs_ddt_zap_default_ibs Ns = Ns Sy 15 Po 32 KiB Pc Pq int
Default DDT ZAP indirect block size as a power of 2. Note that changing this
after creating a DDT on the pool will not affect existing DDTs, only newly
created ones.
.
.It Sy zfs_default_bs Ns = Ns Sy 9 Po 512 B Pc Pq int .It Sy zfs_default_bs Ns = Ns Sy 9 Po 512 B Pc Pq int
Default dnode block size as a power of 2. Default dnode block size as a power of 2.
. .

View File

@ -31,8 +31,8 @@
#include <sys/zap.h> #include <sys/zap.h>
#include <sys/dmu_tx.h> #include <sys/dmu_tx.h>
static const int ddt_zap_leaf_blockshift = 12; static unsigned int ddt_zap_default_bs = 15;
static const int ddt_zap_indirect_blockshift = 12; static unsigned int ddt_zap_default_ibs = 15;
static int static int
ddt_zap_create(objset_t *os, uint64_t *objectp, dmu_tx_t *tx, boolean_t prehash) ddt_zap_create(objset_t *os, uint64_t *objectp, dmu_tx_t *tx, boolean_t prehash)
@ -43,7 +43,7 @@ ddt_zap_create(objset_t *os, uint64_t *objectp, dmu_tx_t *tx, boolean_t prehash)
flags |= ZAP_FLAG_PRE_HASHED_KEY; flags |= ZAP_FLAG_PRE_HASHED_KEY;
*objectp = zap_create_flags(os, 0, flags, DMU_OT_DDT_ZAP, *objectp = zap_create_flags(os, 0, flags, DMU_OT_DDT_ZAP,
ddt_zap_leaf_blockshift, ddt_zap_indirect_blockshift, ddt_zap_default_bs, ddt_zap_default_ibs,
DMU_OT_NONE, 0, tx); DMU_OT_NONE, 0, tx);
return (*objectp == 0 ? SET_ERROR(ENOTSUP) : 0); return (*objectp == 0 ? SET_ERROR(ENOTSUP) : 0);
@ -166,3 +166,10 @@ const ddt_ops_t ddt_zap_ops = {
ddt_zap_walk, ddt_zap_walk,
ddt_zap_count, ddt_zap_count,
}; };
/* BEGIN CSTYLED */
ZFS_MODULE_PARAM(zfs_dedup, , ddt_zap_default_bs, UINT, ZMOD_RW,
"DDT ZAP leaf blockshift");
ZFS_MODULE_PARAM(zfs_dedup, , ddt_zap_default_ibs, UINT, ZMOD_RW,
"DDT ZAP indirect blockshift");
/* END CSTYLED */