summaryrefslogtreecommitdiffstats
path: root/block/blk-mq-tag.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2017-01-25 08:11:38 -0700
committerJens Axboe <axboe@fb.com>2017-01-25 08:11:38 -0700
commit200e86b3372b51e136a382e007b6b904b1dac7e4 (patch)
treef4d92877e39e0ea679fae27568724c898d333dd7 /block/blk-mq-tag.c
parent1cf417530375b475d4a8a9f18dc0867f91e52d78 (diff)
downloadlinux-0-day-200e86b3372b51e136a382e007b6b904b1dac7e4.tar.gz
linux-0-day-200e86b3372b51e136a382e007b6b904b1dac7e4.tar.xz
blk-mq: only apply active queue tag throttling for driver tags
If we have a scheduler attached, we have two sets of tags. We don't want to apply our active queue throttling for the scheduler side of tags, that only applies to driver tags since that's the resource we need to dispatch an IO. Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-mq-tag.c')
-rw-r--r--block/blk-mq-tag.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
index a49ec77c415a9..1b156ca79af62 100644
--- a/block/blk-mq-tag.c
+++ b/block/blk-mq-tag.c
@@ -90,9 +90,11 @@ static inline bool hctx_may_queue(struct blk_mq_hw_ctx *hctx,
return atomic_read(&hctx->nr_active) < depth;
}
-static int __blk_mq_get_tag(struct blk_mq_hw_ctx *hctx, struct sbitmap_queue *bt)
+static int __blk_mq_get_tag(struct blk_mq_alloc_data *data,
+ struct sbitmap_queue *bt)
{
- if (!hctx_may_queue(hctx, bt))
+ if (!(data->flags & BLK_MQ_REQ_INTERNAL) &&
+ !hctx_may_queue(data->hctx, bt))
return -1;
return __sbitmap_queue_get(bt);
}
@@ -118,7 +120,7 @@ unsigned int blk_mq_get_tag(struct blk_mq_alloc_data *data)
tag_offset = tags->nr_reserved_tags;
}
- tag = __blk_mq_get_tag(data->hctx, bt);
+ tag = __blk_mq_get_tag(data, bt);
if (tag != -1)
goto found_tag;
@@ -129,7 +131,7 @@ unsigned int blk_mq_get_tag(struct blk_mq_alloc_data *data)
do {
prepare_to_wait(&ws->wait, &wait, TASK_UNINTERRUPTIBLE);
- tag = __blk_mq_get_tag(data->hctx, bt);
+ tag = __blk_mq_get_tag(data, bt);
if (tag != -1)
break;
@@ -144,7 +146,7 @@ unsigned int blk_mq_get_tag(struct blk_mq_alloc_data *data)
* Retry tag allocation after running the hardware queue,
* as running the queue may also have found completions.
*/
- tag = __blk_mq_get_tag(data->hctx, bt);
+ tag = __blk_mq_get_tag(data, bt);
if (tag != -1)
break;