Please enable JavaScript.
Coggle requires JavaScript to display documents.
ublk abort re-design - Coggle Diagram
ublk abort re-design
design
uring ctx exit
cancel uring commands
abort io requests
prevent new io & abort cmds
uring io task exit
cancel uring commands originated from this task
not mask queue as aborted
need ublk server to deal with the change
how to deal with this io cmd cancel?
what if new io request comes to this slot?
there isn't cmd queued
two contexts
how to sync between blk-mq ctx and uring_ctx
freeze request queue
2 more items...
remove/quiesce device only in case of the whole ctx exit
exit notifier is exclusive with task context
1 more item...
blk-mq needs to use io->cmd to forward request to server
that is the reason why aborting cmds after disk is removed now
goodness is that we can hold ctx->lock when cancelling IOs
quiesce blk-mq context meantime
big problem
io cmd commit & fetch may be queued from new task context
2 more items...
stateless handling
abort pending ublk io request
timeout handler
goal
deal with io hanlding task dead or hang
io handling task may be different with io cmd handling task
focus on real io timeout
since the io command is completed
requirement
uring cmd can be issued from different io tasks
cmd submitter task may not be same with completion task(re-submission)
how to solve io timeout?
deal with after completing uring cmd
blk timeout
sync by rcu
atomic completion
each queue has to issue cmd via single context
facts
in_task may run into fallback wq
so have to fail the cmd
in both ch_uring_cmd and tw cb
tw cb
has to share same mm context with submitter task