blk-mq: Don't reserve a tag for flush request
authorShaohua Li <shli@fusionio.com>
Fri, 24 Jan 2014 21:14:18 +0000 (13:14 -0800)
committerJens Axboe <axboe@fb.com>
Mon, 30 Mar 2015 18:54:40 +0000 (12:54 -0600)
commit84083353ad5536a222a67e593f14a88374bc415a
tree2f0e052bcea3011e66bb7d8df1beb51f9e57200d
parentd9b8a3e422cd992057829d6f42c375f08b964606
blk-mq: Don't reserve a tag for flush request

Reserving a tag (request) for flush to avoid dead lock is a overkill. A
tag is valuable resource. We can track the number of flush requests and
disallow having too many pending flush requests allocated. With this
patch, blk_mq_alloc_request_pinned() could do a busy nop (but not a dead
loop) if too many pending requests are allocated and new flush request
is allocated. But this should not be a problem, too many pending flush
requests are very rare case.

I verified this can fix the deadlock caused by too many pending flush
requests.

Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-flush.c
block/blk-mq.c
include/linux/blk-mq.h