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

ProvideBuffers API for buffer preregistration #34

Closed
wants to merge 7 commits into from

Conversation

withoutboats
Copy link
Collaborator

@withoutboats withoutboats commented Jun 11, 2020

The Drive API is extended with two associated types - the read buffer and the write buffer types - which both must implement a trait called ProvideBuffer. This trait abstracts the notion of providing a buffer for IO to be preformed in.

Three buffer types are provided:

  • HeapBuffer, which is a simple heap allocated buffer
  • RegisteredBuffer, which a buffer that has been preregistered with io_uring_register
  • GroupRegisteredBuffer, (only valid as a read buffer), which uses the automatic buffer selection group registration API

Both of the latter two APIs require the underlying drive handle to implement additional extension to support their operation.

Closes #2

The Drive API is extended with two associated types - the read buffer
and the write buffer types - which both must implement a trait called
`ProvideBuffer`. This trait abstracts the notion of providing a buffer
for IO to be preformed in.

A simple `HeapBuffer` type is provided, which provides a buffer by
allocating it into the heap. However, a more advanced implementation of
a driver could instead implement these traits to make use of io-uring's
buffer preregistration facilities, cycling preregistered buffers through
a buffer pool behind these APIs.

More experimentation is needed to prove out these APIs as actually
sufficient for implementing the desired behavior against io-uring's
existing APIs.

Closes #2
the write side of it previous was wrong and wouldn't work with
non-heapbuffer interfaces
@withoutboats
Copy link
Collaborator Author

Closing as stale

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.

Support more interesting buffer management strategies
1 participant