Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZTS: checkpoint_discard_busy does not set 16M on cleanup #16917

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

tsoome
Copy link
Contributor

@tsoome tsoome commented Jan 2, 2025

Originally hex value is used as decimal.

Motivation and Context

Description

Use correct decimal value for 16M.

How Has This Been Tested?

Types of changes

  • [x ] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

  • [ x] My code follows the OpenZFS code style requirements.
  • I have updated the documentation accordingly.
  • [ x] I have read the contributing document.
  • I have added tests to cover my changes.
  • [ x] I have run the ZFS Test Suite with this change applied.
  • [ x] All commit messages are properly formatted and contain Signed-off-by.

Originally hex value is used as decimal.

Signed-off-by: Toomas Soome <[email protected]>
Copy link
Member

@amotin amotin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better than nothing, but it would be better to restore the original value, as done by many other tests for other tunables, or even by zpool_wait_discard.ksh for this one.

@amotin amotin added the Status: Code Review Needed Ready for review and testing label Jan 2, 2025
@tonyhutter
Copy link
Contributor

@tsoome amotin is correct - may I suggest (untested):

diff --git a/tests/zfs-tests/tests/functional/pool_checkpoint/checkpoint_discard_busy.ksh b/tests/zfs-tests/tests/functional/pool_checkpoint/checkpoint_discard_busy.ksh
index 087aef902..58eb6e969 100755
--- a/tests/zfs-tests/tests/functional/pool_checkpoint/checkpoint_discard_busy.ksh
+++ b/tests/zfs-tests/tests/functional/pool_checkpoint/checkpoint_discard_busy.ksh
@@ -42,8 +42,7 @@ log_unsupported "Skipping, issue https://github.com/openzfs/zfs/issues/12053"
 
 function test_cleanup
 {
-       # reset memory limit to 16M
-       set_tunable64 SPA_DISCARD_MEMORY_LIMIT 1000000
+       restore_tunable SPA_DISCARD_MEMORY_LIMIT
        cleanup_nested_pools
 }
 
@@ -69,6 +68,7 @@ log_onexit test_cleanup
 #      map, we should have even more time to
 #      verify this.
 #
+log_must save_tunable SPA_DISCARD_MEMORY_LIMIT
 set_tunable64 SPA_DISCARD_MEMORY_LIMIT 128
 
 log_must zpool checkpoint $NESTEDPOOL
@@ -102,7 +102,7 @@ log_mustnot zpool remove $NESTEDPOOL $FILEDISK1
 log_mustnot zpool reguid $NESTEDPOOL
 
 # reset memory limit to 16M
-set_tunable64 SPA_DISCARD_MEMORY_LIMIT 16777216
+restore_tunable SPA_DISCARD_MEMORY_LIMIT
 
 nested_wait_discard_finish
 

Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to go ahead and merge this as is. We can follow up with the nicer fix which preserves and restores the value.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Jan 2, 2025
@behlendorf behlendorf merged commit d35f9f2 into openzfs:master Jan 2, 2025
23 of 26 checks passed
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Jan 3, 2025
Originally hex value is used as decimal.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Toomas Soome <[email protected]>
Closes openzfs#16917
@tsoome tsoome deleted the pool_checkpoint branch January 3, 2025 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants