Please enable JavaScript.
Coggle requires JavaScript to display documents.
io_wq - Coggle Diagram
io_wq
overview
hashed work?
for write
on regular file
avoid conflict on write same inode concurrently
core concepts
io_wq
per-tctx or per-task
wq->task points to tctx's task
bounded
support both bound and unbound
->cpu_mask
IORING_REGISTER_IOWQ_AFF
cpuhp
all workers of this wq respects this mask
workers
bound or unbound
difference is in concurrency
how many workers
work
cur_work
next_work
linked to io_wq->all_list
created in io_uring context
almost inherit everything from its parent
work
hashed
non-hashed
->hash
reference to ctx->hash_map which creates the io_wq
but io_wq is supposed to serve multiple ctxs
io_queue_iowq
tctx = req->task->io_uring
io_init_wq_offload
topics
cancel
cancel pending works linked in acct->work_list
cancel running works
worker->next_work
worker->cur_work
queue
io_wq_enqueue
create
wq is created in allocating tctx
io_init_wq_offload
create worker
io_wq_create_worker
create_io_worker
create_io_thread
io_wq_worker,
io_worker_handle_work
worker exit
io_worker_exit
questions
why does sqpoll creates io_wq/tctx?
io_submit_sqes called in sqpoll ctx
sqpoll supports multiple ctxs too by attach
basic same with normal task