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

Don't cap read/write buffer size? #7

Open
nh2 opened this issue Jun 19, 2023 · 0 comments
Open

Don't cap read/write buffer size? #7

nh2 opened this issue Jun 19, 2023 · 0 comments

Comments

@nh2
Copy link

nh2 commented Jun 19, 2023

I tried to tell pv to make large read()/write() sycalls (it is much more efficient to make large syscalls on e.g. networked file systems) using --buffer-size 16M.

However, I found that it had no effect; pv was making 512Ki-sized IO operations.

This is due to:

#define MAX_READ_AT_ONCE	524288	 /* max to read() in one go */
#define MAX_WRITE_AT_ONCE	524288	 /* max to write() in one go */

// ...

		    read(fd, buf,
			 count >
			 MAX_READ_AT_ONCE ? MAX_READ_AT_ONCE : count);

Why do these limits exisst?

Is there a point to allowing a --buffer-size 16M when the reads and writes are capped to small buffers anyway?

Could this restriction be lifted, removing the hardcoded limits, so that these syscalls can be as large as the --buffer size?

Thanks

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

1 participant