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

Use /dev/zero for disk rate check #829

Closed
wants to merge 1 commit into from

Conversation

q-wertz
Copy link
Contributor

@q-wertz q-wertz commented Jan 9, 2025

Pull Request Details

/dev/random is slow by design and probably a bottleneck in the check.
/dev/zero should be faster.

Description

On test we triggered the warning of a too slow disk write speed.
The test internally uses dd to test the disk write speed but with the
if=/dev/random which will be slow as soon as random source is
depleted. See e.g.

~ $ dd if=/dev/zero of=/home/username/Downloads/test.dat bs=8k count=10k
10240+0 records in
10240+0 records out
83886080 bytes (84 MB, 80 MiB) copied, 0,0512609 s, 1,6 GB/s
~ $ dd if=/dev/random of=/home/username/Downloads/test.dat bs=8k count=10k
10240+0 records in
10240+0 records out
83886080 bytes (84 MB, 80 MiB) copied, 0,292775 s, 287 MB/s

This leads to inaccurate test results and warnings that might unsettle
the user.

Related Issue

Which devices/areas does this affect?

All devices.

Testing Done

See above.

Checklist

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project. See CODING.md.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes, and all previous tests pass.
  • I have checked all compat numbers if they need updating (FPGA compat,
    MPM compat, noc_shell, specific RFNoC block, ...)

/dev/random is slow by design and probably a bottleneck in the check. /dev/zero should be faster.
@joergho
Copy link
Contributor

joergho commented Feb 3, 2025

Thank you @q-wertz for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.

I have read the CLA Document and I hereby sign the CLA

@q-wertz
Copy link
Contributor Author

q-wertz commented Feb 4, 2025

I have read the CLA Document and I hereby sign the CLA

@joergho joergho closed this Feb 7, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Feb 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants