Skip to content

grace wants to do some zero copy #207

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

Merged
merged 5 commits into from
May 21, 2021
Merged

Conversation

glommer
Copy link
Contributor

@glommer glommer commented May 17, 2021

This captures a bit of my experience in trying to leverage Linux zero-copy with Rust.

I find that Grace is very likely, given her background, to have had similar encounters.

@jonhoo
Copy link
Contributor

jonhoo commented May 17, 2021

This is very related to some of the difficulties observed in tokio-rs/tokio-uring#1, and why the buffer management there had to be changed somewhat. @carllerche may have more relevant thoughts.

Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks good to me.

Copy link
Member

@rylev rylev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - I do wonder if it would help to expand the code samples slightly to explicitly show trying to pass buffers to the OS and not being able to do so due to lifetimes.

) -> Poll<Result<usize, Error>>
```

She notices that the buffer is always passed to the invocation, but she can't pass it down to the operating system: because of the well-known cancellation problem, the buffer is
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be helpful to either link to a good resource on the cancellation problem or provide a brief description for those unfamiliar with it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if there is a link that is canonical for that problem (Boats blog does a good job explaining the whole problem, and it's already mentioned at some point).

I'd be happy to add a paragraph with a summary.

@glommer
Copy link
Contributor Author

glommer commented May 21, 2021

Thank you all for your comments and sorry it took me long to get to this.
Suggestions are now incorporated.

@nikomatsakis
Copy link
Contributor

Thanks @glommer!

@nikomatsakis nikomatsakis merged commit d66aec4 into rust-lang:master May 21, 2021
@glommer glommer deleted the grace branch May 21, 2021 17:34
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

Successfully merging this pull request may close these issues.

4 participants