Please enable JavaScript.
Coggle requires JavaScript to display documents.
ublk ctrl cmd async/.await - Coggle Diagram
ublk ctrl cmd async/.await
requirements
run all control commands via async/.await
mutable UblkCtrlDev reference
switch to mutex protection
device creation
ctrl io task
simpler interface for device create & start
make SQE128 uring as per-task
move to UblkSession
per task
add io_uring reference to UblkCtrl
create multiple ublk device in single thread context
all devices share single io task
fast
creating is run in parallel
code organization
main entry function
create ctrl task
run task
queue 0 context
create io tasks
block_on
main framework
control task
create deices
create & start queue handler
io tasks
code flow
ublk_run_task(start_dev_task)
thread_join(queue handles)
ublk_run_task(stop_dev_task)
create devices
wait
executor loop
join_thread(handles)
block_on(io_tasks)
async support code
reuse ublk_wake_task
reuse MY_SLAB
reuse io_uring for async executor
non-local Executor
shared context framework
queue 0 re-use current context
todo
move io_uring instance into executor
io_uring can be per-thread variable
executor can be one local variable
make io executor as per-task
not necessary
plan
v0.3
support async ctrl command
all kinds of cleanup
codebase is clean enough for adding new features
LTS?
yes
verified on rublk
released in Mar.
v0.4
support to create multiple devices in single contexts
thousands of ublk device
ublk add_grp
development
policy
move device add out of create_devices
re-design lib helpers for async control command only
use async run_task to implement current sync API
then add new lib helpers to re-organize code for single target only
corner cases
new_simple
per-task io_uring
thread_local!(Option<io_uring>)