ZTS: checkpoint_discard_busy should use save_tunable/restore_tunable

Instead of using hardwired value for SPA_DISCARD_MEMORY_LIMIT,
use save_tunable and restore_tunable to restore the pre-test state.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Toomas Soome <tsoome@me.com>
Closes #16919
This commit is contained in:
Toomas Soome 2025-01-04 00:48:30 +02:00 committed by Brian Behlendorf
parent 4425a7bb85
commit 125731436d

View File

@ -42,8 +42,8 @@ log_unsupported "Skipping, issue https://github.com/openzfs/zfs/issues/12053"
function test_cleanup function test_cleanup
{ {
# reset memory limit to 16M # reset to original value
set_tunable64 SPA_DISCARD_MEMORY_LIMIT 16777216 log_must restore_tunable SPA_DISCARD_MEMORY_LIMIT
cleanup_nested_pools cleanup_nested_pools
} }
@ -69,6 +69,7 @@ log_onexit test_cleanup
# map, we should have even more time to # map, we should have even more time to
# verify this. # verify this.
# #
log_must save_tunable SPA_DISCARD_MEMORY_LIMIT
set_tunable64 SPA_DISCARD_MEMORY_LIMIT 128 set_tunable64 SPA_DISCARD_MEMORY_LIMIT 128
log_must zpool checkpoint $NESTEDPOOL log_must zpool checkpoint $NESTEDPOOL
@ -101,8 +102,8 @@ log_mustnot zpool checkpoint -d $NESTEDPOOL
log_mustnot zpool remove $NESTEDPOOL $FILEDISK1 log_mustnot zpool remove $NESTEDPOOL $FILEDISK1
log_mustnot zpool reguid $NESTEDPOOL log_mustnot zpool reguid $NESTEDPOOL
# reset memory limit to 16M # reset to original value
set_tunable64 SPA_DISCARD_MEMORY_LIMIT 16777216 log_must restore_tunable SPA_DISCARD_MEMORY_LIMIT
nested_wait_discard_finish nested_wait_discard_finish