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

flushing takes a while, but there's no indication it's happening #5

Open
larswirzenius opened this issue Feb 23, 2020 · 2 comments
Open
Assignees

Comments

@larswirzenius
Copy link

vbig --flush --progress /dev/usb-device for an 8 gigabyte device fills the disk block cache quickly, and then takes quite a while to flush out the buffer to the device. While the flushing is happening, there is no indication that something is happening in the terminal from which I launched vbig. If I didn't know what's happening, I would've assumed somethings broken.

This would've been acceptable without --progress.

Suggestion: show "flushing" if --progress is used, similar to the "writing" and "verifying" messages. Obviously "flushing" doesn't need to how much remains to flush, since that's difficult to get from the kernel.

Related suggestion: open the output file with O_DIRECT, when writing, at least on Linux, to avoid a lengthy flushing wait. Possibly O_SYNC.

@ewxrjk ewxrjk self-assigned this Feb 24, 2020
ewxrjk added a commit that referenced this issue Feb 24, 2020
@ewxrjk
Copy link
Owner

ewxrjk commented Feb 24, 2020

I've added a progress indicator but I'll keep this issue open for a while as a context for any further improvements.

Do you (or anyone) know of a way to get the kernel to report how much unwritten cached data is associated with a given file? (Doesn't have to be portable, I expect most users are on Linux anyway). Then we could have accurate progress reporting while keeping the (admittedly small) performance benefit of having the random number generation and the physical writes concurrent.

@larswirzenius
Copy link
Author

I have no idea if it's even possible to get the unwritten-cached-bytes for a file descriptor, sorry.

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

No branches or pull requests

2 participants