]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
blk-mq: bump max tag depth to 10K tags
authorJens Axboe <axboe@fb.com>
Thu, 5 Jun 2014 21:21:56 +0000 (15:21 -0600)
committerJens Axboe <axboe@fb.com>
Fri, 6 Jun 2014 14:04:46 +0000 (08:04 -0600)
For some scsi-mq cases, the tag map can be huge. So increase the
max number of tags we support.

Additionally, don't fail with EINVAL if a user requests too many
tags. Warn that the tag depth has been adjusted down, and store
the new value inside the tag_set passed in.

Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq.c
include/linux/blk-mq.h

index 4e4cd62080524bf05644cfc59c78218d3a2c4a98..a6ee74e27957eab3aedb33612d56a582d38b65b5 100644 (file)
@@ -1967,13 +1967,19 @@ static int blk_mq_queue_reinit_notify(struct notifier_block *nb,
        return NOTIFY_OK;
 }
 
+/*
+ * Alloc a tag set to be associated with one or more request queues.
+ * May fail with EINVAL for various error conditions. May adjust the
+ * requested depth down, if if it too large. In that case, the set
+ * value will be stored in set->queue_depth.
+ */
 int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set)
 {
        int i;
 
        if (!set->nr_hw_queues)
                return -EINVAL;
-       if (!set->queue_depth || set->queue_depth > BLK_MQ_MAX_DEPTH)
+       if (!set->queue_depth)
                return -EINVAL;
        if (set->queue_depth < set->reserved_tags + BLK_MQ_TAG_MIN)
                return -EINVAL;
@@ -1981,6 +1987,11 @@ int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set)
        if (!set->nr_hw_queues || !set->ops->queue_rq || !set->ops->map_queue)
                return -EINVAL;
 
+       if (set->queue_depth > BLK_MQ_MAX_DEPTH) {
+               pr_info("blk-mq: reduced tag depth to %u\n",
+                       BLK_MQ_MAX_DEPTH);
+               set->queue_depth = BLK_MQ_MAX_DEPTH;
+       }
 
        set->tags = kmalloc_node(set->nr_hw_queues *
                                 sizeof(struct blk_mq_tags *),
index 0feedebfde48a5e3099e79d156828f8e302e1401..a002cf1914270631a625aec015cc472f248f21cc 100644 (file)
@@ -135,7 +135,7 @@ enum {
        BLK_MQ_S_STOPPED        = 0,
        BLK_MQ_S_TAG_ACTIVE     = 1,
 
-       BLK_MQ_MAX_DEPTH        = 2048,
+       BLK_MQ_MAX_DEPTH        = 10240,
 
        BLK_MQ_CPU_WORK_BATCH   = 8,
 };