Please enable JavaScript.
Coggle requires JavaScript to display documents.
liublk-rs async final shape - Coggle Diagram
liublk-rs async final shape
overview
executor
per-io task
per-task spawn
support wakeup
for supporting 3rd party futures
futures
io_uring Future
async mutex
support
can be used for implementing event
used in qcow2 cache
libublk
io FIRST/LAST flag
important for nbd
set sqe link or not
it should be a must because rust doesn't allow to touch SQE after it is pushed to io_uring.submission()
so the link flag has to be set from the beginning
lazy submission
wait beforehandle with pre-calculated user data
build and submit all SQEs after the batch is done
record every tag for handling the command
requires executor to be capable of completing failed sqe
already supported
also used in event_fd
when one IO is offloaded to another context
1 more item...
RW captured environment variables in io task
need to verify
background io handler
useful for both nbd and qcow2
requirements
nbd
FIRST/LAST flag
helpful for setting sqe link flag
extra io task for meta IO
spawn in background io handler
background io handler
qcow2
extra io task for meta IO
background io handler
spawn io task in bg io handler
tens of thousands of ublks
shared ring
shared pthreads
async/.await in control plane
tokio-uring
questions
why tokio-uring can't be used
lifetime
spawn_local<F>(future: F) where F: Future + 'static
epoll
4*syscalls
2 io_uring_enter()
one for submission
another for getting event
each io_uring_enter() needs one epoll_wait
avoid slab allocation cost
ublk io command has unique tag already
each OP allocates one unique tag
not see big benefit from the complexity
io_uring crate is more flexible
just like Rust version of liburing
io_uring is bound with runtime
may have to expose io command handle details
programming model is totally different with non-async version
exclusive with libublk's uring async op