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: Use /dev/urandom instead of /dev/random #16442

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

tonyhutter
Copy link
Contributor

Motivation and Context

Use /dev/urandom so we never have to wait on entropy.

Description

Psudorandom numbers are fine for ZTS. Use /dev/urandom since it's faster than /dev/random.

How Has This Been Tested?

buildbot will test

Types of changes

  • 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:

Use /dev/urandom so we never have to wait on entropy.

Signed-off-by: Tony Hutter <[email protected]>
@rincebrain
Copy link
Contributor

On 5.6+, this will do nothing, because they're identical once the CSPRNG is initialized, and ZTS will probably never be running before that's true.

So unless you're hoping to speed up the CentOS 8 and Ubuntu 20.04 runs specifically, this seems pretty academic.

@tonyhutter
Copy link
Contributor Author

@rincebrain to tell you the truth, this PR started as a low-effort attempt to fix the recent block_cloning_rlimit_fsize.ksh failures on Centos 8:

https://build.openzfs.org/builders/CentOS%208%20x86_64%20%28TEST%29/builds/3643/steps/shell_4/logs/tests
https://build.openzfs.org/builders/CentOS%208%20x86_64%20%28TEST%29/builds/3638/steps/shell_4/logs/tests
https://build.openzfs.org/builders/CentOS%208%20x86_64%20%28TEST%29/builds/3637/steps/shell_4/logs/tests

I was looking at block_cloning_rlimit_fsize.ksh and noticed the dd if=/dev/random of=/$TESTPOOL/file1 bs=1 count=1000 in there and thought it may be hanging while waiting for entropy. I wasn't convinced that was the case but I figured it was worth a shot. I saw some other test cases where we use /dev/random, and thus this PR was born.

It does look like this PR passed block_cloning_rlimit_fsize.ksh which is encouraging: https://build.openzfs.org/builders/CentOS%208%20x86_64%20%28TEST%29/builds/3642/steps/shell_4/logs/tests

@behlendorf behlendorf merged commit d06de4f into openzfs:master Aug 14, 2024
16 of 23 checks passed
@behlendorf behlendorf added the Status: Accepted Ready to integrate (reviewed, tested) label Aug 14, 2024
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Sep 4, 2024
Use /dev/urandom so we never have to wait on entropy.

Reviewed-by: George Melikov <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tony Hutter <[email protected]>
Closes openzfs#16442
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