diff options
author | Jens Axboe <axboe@fb.com> | 2014-10-07 08:39:20 -0600 |
---|---|---|
committer | Luis Henriques <luis.henriques@canonical.com> | 2014-11-17 14:11:42 +0000 |
commit | 36df0107193c45f662c9d51d80270f4edb2cd7cc (patch) | |
tree | d1e15110fe875b296f6bbba39f1c187e85a0a73f /block | |
parent | c4221e3fd7c6dccc8b3b9033f9877138d444f2cc (diff) | |
download | linux-stable-36df0107193c45f662c9d51d80270f4edb2cd7cc.tar.gz linux-stable-36df0107193c45f662c9d51d80270f4edb2cd7cc.tar.bz2 linux-stable-36df0107193c45f662c9d51d80270f4edb2cd7cc.zip |
blk-mq: fix potential hang if rolling wakeup depth is too high
commit abab13b5c4fd1fec4f9a61622548012d93dc2831 upstream.
We currently divide the queue depth by 4 as our batch wakeup
count, but we split the wakeups over BT_WAIT_QUEUES number of
wait queues. This defaults to 8. If the product of the resulting
batch wake count and BT_WAIT_QUEUES is higher than the device
queue depth, we can get into a situation where a task goes to
sleep waiting for a request, but never gets woken up.
Reported-by: Bart Van Assche <bvanassche@acm.org>
Fixes: 4bb659b156996
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-mq-tag.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index c1b92426c95e..74a4168ea34e 100644 --- a/block/blk-mq-tag.c +++ b/block/blk-mq-tag.c @@ -463,8 +463,8 @@ static void bt_update_count(struct blk_mq_bitmap_tags *bt, } bt->wake_cnt = BT_WAIT_BATCH; - if (bt->wake_cnt > depth / 4) - bt->wake_cnt = max(1U, depth / 4); + if (bt->wake_cnt > depth / BT_WAIT_QUEUES) + bt->wake_cnt = max(1U, depth / BT_WAIT_QUEUES); bt->depth = depth; } |