Please enable JavaScript.
Coggle requires JavaScript to display documents.
userspace block device - Coggle Diagram
userspace block device
requirement
one simple/efficient infra
implement IO logic in userspace side
bcache userspace
dm userspace
loop
another candidate for kernel loop
simulate block device
observe io pattern in device side
totally normal block device
design
how to return kernel side cmd to userspace
io_uring pt with one dedicated cmd queue
io_uring sqe submitted beforehand
one request returned to userspace by cqe->userdata and the dedicated cmd queue
how to setup communication between ubdsrv and ubd_drv
one dedicated chdev is for communicate with ubd server
submit fetch_req command to ubd driver
setup queue command buffer
mmap
command protocol
control commands
ADD_DEV
DEL_DEV
START_DEV
STOP DEV
GET_INFO
SET_INFO
IO commands
FETCH_IO
issued to ubd driver for fetching io cmd
COMMIT_IO
commit io result to ubd driver
COMMIT_AND_FETCH_IO
both fetch rq and commit rq result
terms
kernel block driver
ubd driver(kernel side)
userspace block device server
ubd server
ubd target
handling io request from ubd driver
1st goal
function
loop
use fio to compare dio perf
null
todo
handling ->queue_rqs
batching io_uring completion
need more io_uring knowledge
most important thing
origin of batching handling
zero copy
map request pages to userspace vm
refer to recent tcmu's zero copy
maybe reuse the code
ubd tgt can't use fixed buffer any more
still can be batched
use io_uring to handle io in userspace
implement it for ubd-loop
wait on both io cmd ring_fd and io handling ring_fd