Please enable JavaScript.
Coggle requires JavaScript to display documents.
blk-mq: excessive context switch - Coggle Diagram
blk-mq: excessive context switch
background
request allocation vs. driver tag
request allocation
wait & sync allocation
driver tag allocation
no wait & async allocation
both share same release/wakeup code
sbitmap's batch wakeup
observations
IO completion is muchslower than submission
one reason of soft lockup
no such issue in SQ req allocation path
ideas
end bio in async way
blk-mq: per-ctx tag caching
only for driver tag allocation
batched request allocation
for HDD.
release driver tag earlier
Hou Tao's approach
sbq->stash_ready
yes
state switched during successful allocation
starting state:
sbq->stashed_bits == depth/STASH_RATIO
ending state
sbq->stashed_bits == 0
middle state
sbq->stashed_bits--
in wakeup side
wake up one sleeper each time
no
starting state
sbq->stashed_bits == 0
middle state
sbq->stashed_bits++
ending state:
sbq->stashed_bits ==
sbq->sb.depth / SBQ_STASH_RATIO
sbq->stash_ready = true
state is switched during wakeup
in wakeup side
do not wakeup anyone during this state
core ideas
don't wakeup in 1st wakeup stage
sbq->stashed_bits++ <
sbq->sb.depth / SBQ_STASH_RATIO
not stash ready state
wakeup up one sleeper each time
stash ready state
--sbq->stashed_bits > 0
wait & wakeup
wait for one batch
wakeup one by one for batch times