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

Document the random behavior of choosing which files are being read? #16

Open
kwinz opened this issue Aug 15, 2023 · 1 comment
Open

Comments

@kwinz
Copy link

kwinz commented Aug 15, 2023

Right now the documentation states:
It then randomly chooses a pair of these and reads them back checking they are the same.

So by reading this I would assume that due to random chance it would be possible that even if I let this run for multiple days one file was already read e.g. 4 times, while another file hasn't been read ever. In practice by looking at the implementation it seems to me that not just stressdisk cycle but also stressdisk run is implemented in rounds. And during each round each file is read exactly twice before progressing to the next round. (Ignoring the unlucky case where one file would be selected to be compared to itself then that check would probably be skipped).
Sorry if I got anything wrong here, I just had a brief glance at the code.

Do we want to document this behaviour? I think sometimes it's useful to make sure that every file has been read at least once if you want to test some hardware. I know stressdisk's main purpose is seems to be to create a lot of seek stress to test the drive this way, but ensuring every file was tried at least once as soon as it prints "Starting round 2" would be a nice additional guarantee.

Or is this implementation detail undocumented on purpose? E.g. so the implementation can change in the future.

@kwinz kwinz changed the title Document the random behavior if files being read? Document the random behavior of chosing which files are being read? Aug 15, 2023
@kwinz kwinz changed the title Document the random behavior of chosing which files are being read? Document the random behavior of choosing which files are being read? Aug 15, 2023
@ncw
Copy link
Owner

ncw commented Aug 15, 2023

And during each round each file is read exactly twice before progressing to the next round. (Ignoring the unlucky case where one file would be selected to be compared to itself then that check would probably be skipped).

Yes that is how it works, each file is read twice per round on a random schedule. Also it is never compared to itself.

So the docs could be more accurate! Do you want to suggest better wording?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants