Please enable JavaScript.
Coggle requires JavaScript to display documents.
blk-mq: sbitmap wakeup - Coggle Diagram
blk-mq: sbitmap wakeup
allocation
ws selection in case of blocking
bt_wait_ptr(bt, hctx)
sbq_wait_ptr(bt, &hctx->wait_index)
spred wait on multiple wait_queue
when to remove the wait item
blk_mq_get_tag
blk_mq_dispatch_wake
free
alloc_hint
used wrong for driver tag allocation
useds almost correct for request allocation
__sbq_wake_up
wakeup_nr(wake_batch)
run once for each ws in ws->wait_cnt times
each ws is checked in RR style
basics
one sbq has 8 wait_state
wake_batch
pre-calculated
core part of the batching wakeup
how to guarantee that one ws can be wakeup
batching wakep
wakeup once after running the ws .wake_batch times
each time, wakeup .wake_batch sleepers
ws[i].wait_cnt
initialized as ->wake_batch
atomic_dec_return(&ws->wait_cnt) in __sbq_wake_up()
do real wakeup_nr when it returns <= 0
->wake_index
the last wait_state waked up
updated in rr style
sbq_wake_ptr
return one active ws if there is
__sbq_wake_up
select one ws and try to wakeup it if it can be done in batching
ws_active
questions
how to know if the current wakeup is the last one?
why is 'wakeup_batch' perfect?