Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
blk-mq: make restart mechanism more reliable
BLK_STS_RESOURCE can be returned from driver when any resource is running out of. And the resource may not be related with tags, such as kmalloc(GFP_ATOMIC), when queue is idle under this kind of BLK_STS_RESOURCE, restart can't work any more, then IO hang may be caused. This patch deals with this situation by running the queue after 10ms, and serves as the last straw to avoid IO hang. The introduced cost is small: - the combined condition of 'need_restart and BLK_STS_RESOURCE' can seldom be triggered - for TAG_SHARED, hctx->nr_active is used to check if queue is busy - for non-TAG_SHARED, sbitmap_any_bit_set() is used to check if queue is busy in case of io scheduler. When BLK_STS_RESOURCE is returned and SCHED_RESTART is set, most of times it means there are too many inflight requests, and sbitmap_any_bit_set() can return very quickly. For none scheduler, we have to walk on the tag bitmap to see if there is any in-flight request, which should be quick too. Signed-off-by: Ming Lei <ming.lei@redhat.com>
- Loading branch information
Ming Lei
committed
Jan 18, 2018
1 parent
dfd672c
commit f866ce0
Showing
1 changed file
with
92 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters