diff options
author | Brian Behlendorf <[email protected]> | 2021-04-11 21:49:13 -0700 |
---|---|---|
committer | Tony Hutter <[email protected]> | 2021-06-23 13:22:14 -0700 |
commit | 0839934d84adbd295e767808a7debbbea171bdb0 (patch) | |
tree | c62cc194ee6d329a56ff7fff4d71d673163b4719 | |
parent | f831d1377f02688db88105417e6d8884585a30ce (diff) |
ZTS: fix removal_condense_export test case
It's been observed in the CI that the required 25% of obsolete bytes
in the mapping can be to high a threshold for this test resulting in
condensing never being triggered and a test failure. To prevent these
failures make the existing zfs_condense_indirect_obsolete_pct tuning
available so the obsolete percentage can be reduced from 25% to 5%
during this test.
Reviewed-by: Ryan Moeller <[email protected]>
Reviewed-by: George Melikov <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #11869
-rw-r--r-- | man/man5/zfs-module-parameters.5 | 13 | ||||
-rw-r--r-- | module/zfs/vdev_indirect.c | 7 | ||||
-rwxr-xr-x | tests/test-runner/bin/zts-report.py.in | 1 | ||||
-rw-r--r-- | tests/zfs-tests/include/tunables.cfg | 1 | ||||
-rwxr-xr-x | tests/zfs-tests/tests/functional/removal/removal_condense_export.ksh | 2 |
5 files changed, 21 insertions, 3 deletions
diff --git a/man/man5/zfs-module-parameters.5 b/man/man5/zfs-module-parameters.5 index 0a14e62f3..fae60224d 100644 --- a/man/man5/zfs-module-parameters.5 +++ b/man/man5/zfs-module-parameters.5 @@ -1373,6 +1373,19 @@ Default value: \fB0\fR (no throttle). .sp .ne 2 .na +\fBzfs_condense_indirect_obsolete_pct\fR (int) +.ad +.RS 12n +Minimum percent of obsolete bytes in vdev mapping required to attempt to +condense (see \fBzfs_condense_indirect_vdevs_enable\fR). Intended for use +with the test suite to facilitate triggering condensing as needed. +.sp +Default value: \fB25\fR%. +.RE + +.sp +.ne 2 +.na \fBzfs_condense_indirect_vdevs_enable\fR (int) .ad .RS 12n diff --git a/module/zfs/vdev_indirect.c b/module/zfs/vdev_indirect.c index 6a74b5971..6f2ac5663 100644 --- a/module/zfs/vdev_indirect.c +++ b/module/zfs/vdev_indirect.c @@ -181,7 +181,7 @@ int zfs_condense_indirect_vdevs_enable = B_TRUE; * condenses. Higher values will condense less often (causing less * i/o); lower values will reduce the mapping size more quickly. */ -int zfs_indirect_condense_obsolete_pct = 25; +int zfs_condense_indirect_obsolete_pct = 25; /* * Condense if the obsolete space map takes up more than this amount of @@ -446,7 +446,7 @@ vdev_indirect_should_condense(vdev_t *vd) * by the mapping. */ if (bytes_obsolete * 100 / bytes_mapped >= - zfs_indirect_condense_obsolete_pct && + zfs_condense_indirect_obsolete_pct && mapping_size > zfs_condense_min_mapping_bytes) { zfs_dbgmsg("should condense vdev %llu because obsolete " "spacemap covers %d%% of %lluMB mapping", @@ -1886,6 +1886,9 @@ EXPORT_SYMBOL(vdev_obsolete_sm_object); ZFS_MODULE_PARAM(zfs_condense, zfs_condense_, indirect_vdevs_enable, INT, ZMOD_RW, "Whether to attempt condensing indirect vdev mappings"); +ZFS_MODULE_PARAM(zfs_condense, zfs_condense_, indirect_obsolete_pct, INT, ZMOD_RW, + "Minimum obsolete percent of bytes in the mapping to attempt condensing"); + ZFS_MODULE_PARAM(zfs_condense, zfs_condense_, min_mapping_bytes, ULONG, ZMOD_RW, "Don't bother condensing if the mapping uses less than this amount of " "memory"); diff --git a/tests/test-runner/bin/zts-report.py.in b/tests/test-runner/bin/zts-report.py.in index 6b779fef8..c4280b497 100755 --- a/tests/test-runner/bin/zts-report.py.in +++ b/tests/test-runner/bin/zts-report.py.in @@ -261,7 +261,6 @@ if sys.platform.startswith('freebsd'): 'delegate/zfs_allow_003_pos': ['FAIL', known_reason], 'inheritance/inherit_001_pos': ['FAIL', '11829'], 'pool_checkpoint/checkpoint_zhack_feat': ['FAIL', '11854'], - 'removal/removal_condense_export': ['FAIL', known_reason], 'resilver/resilver_restart_001': ['FAIL', known_reason], 'zvol/zvol_misc/zvol_misc_volmode': ['FAIL', known_reason], }) diff --git a/tests/zfs-tests/include/tunables.cfg b/tests/zfs-tests/include/tunables.cfg index 7d99c0772..6da3a17e5 100644 --- a/tests/zfs-tests/include/tunables.cfg +++ b/tests/zfs-tests/include/tunables.cfg @@ -25,6 +25,7 @@ CHECKSUM_EVENTS_PER_SECOND checksum_events_per_second zfs_checksum_events_per_se COMMIT_TIMEOUT_PCT commit_timeout_pct zfs_commit_timeout_pct COMPRESSED_ARC_ENABLED compressed_arc_enabled zfs_compressed_arc_enabled CONDENSE_INDIRECT_COMMIT_ENTRY_DELAY_MS condense.indirect_commit_entry_delay_ms zfs_condense_indirect_commit_entry_delay_ms +CONDENSE_INDIRECT_OBSOLETE_PCT condense.indirect_obsolete_pct zfs_condense_indirect_obsolete_pct CONDENSE_MIN_MAPPING_BYTES condense.min_mapping_bytes zfs_condense_min_mapping_bytes DBUF_CACHE_MAX_BYTES dbuf_cache.max_bytes dbuf_cache_max_bytes DEADMAN_CHECKTIME_MS deadman.checktime_ms zfs_deadman_checktime_ms diff --git a/tests/zfs-tests/tests/functional/removal/removal_condense_export.ksh b/tests/zfs-tests/tests/functional/removal/removal_condense_export.ksh index 7648900ac..8de17ff2e 100755 --- a/tests/zfs-tests/tests/functional/removal/removal_condense_export.ksh +++ b/tests/zfs-tests/tests/functional/removal/removal_condense_export.ksh @@ -24,6 +24,7 @@ function reset { log_must set_tunable64 CONDENSE_INDIRECT_COMMIT_ENTRY_DELAY_MS 0 + log_must set_tunable64 CONDENSE_INDIRECT_OBSOLETE_PCT 25 log_must set_tunable64 CONDENSE_MIN_MAPPING_BYTES 131072 default_cleanup_noexit } @@ -31,6 +32,7 @@ function reset default_setup_noexit "$DISKS" "true" log_onexit reset log_must set_tunable64 CONDENSE_INDIRECT_COMMIT_ENTRY_DELAY_MS 5000 +log_must set_tunable64 CONDENSE_INDIRECT_OBSOLETE_PCT 5 log_must set_tunable64 CONDENSE_MIN_MAPPING_BYTES 1 log_must zfs set recordsize=512 $TESTPOOL/$TESTFS |