diff options
author | Jens Axboe <axboe@fb.com> | 2014-06-05 17:21:56 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-06-06 10:04:46 -0400 |
commit | a4391c6465d9c978fd4bded12e34bdde3f5458f0 (patch) | |
tree | fc5d01ebc746cec35f0d4628f05349b1d87dd8a8 /block/blk-mq.c | |
parent | f27b087b81b70513b8c61ec20596c868f7b93474 (diff) |
blk-mq: bump max tag depth to 10K tags
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>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r-- | block/blk-mq.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index 4e4cd6208052..a6ee74e27957 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
@@ -1967,13 +1967,19 @@ static int blk_mq_queue_reinit_notify(struct notifier_block *nb, | |||
1967 | return NOTIFY_OK; | 1967 | return NOTIFY_OK; |
1968 | } | 1968 | } |
1969 | 1969 | ||
1970 | /* | ||
1971 | * Alloc a tag set to be associated with one or more request queues. | ||
1972 | * May fail with EINVAL for various error conditions. May adjust the | ||
1973 | * requested depth down, if if it too large. In that case, the set | ||
1974 | * value will be stored in set->queue_depth. | ||
1975 | */ | ||
1970 | int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set) | 1976 | int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set) |
1971 | { | 1977 | { |
1972 | int i; | 1978 | int i; |
1973 | 1979 | ||
1974 | if (!set->nr_hw_queues) | 1980 | if (!set->nr_hw_queues) |
1975 | return -EINVAL; | 1981 | return -EINVAL; |
1976 | if (!set->queue_depth || set->queue_depth > BLK_MQ_MAX_DEPTH) | 1982 | if (!set->queue_depth) |
1977 | return -EINVAL; | 1983 | return -EINVAL; |
1978 | if (set->queue_depth < set->reserved_tags + BLK_MQ_TAG_MIN) | 1984 | if (set->queue_depth < set->reserved_tags + BLK_MQ_TAG_MIN) |
1979 | return -EINVAL; | 1985 | return -EINVAL; |
@@ -1981,6 +1987,11 @@ int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set) | |||
1981 | if (!set->nr_hw_queues || !set->ops->queue_rq || !set->ops->map_queue) | 1987 | if (!set->nr_hw_queues || !set->ops->queue_rq || !set->ops->map_queue) |
1982 | return -EINVAL; | 1988 | return -EINVAL; |
1983 | 1989 | ||
1990 | if (set->queue_depth > BLK_MQ_MAX_DEPTH) { | ||
1991 | pr_info("blk-mq: reduced tag depth to %u\n", | ||
1992 | BLK_MQ_MAX_DEPTH); | ||
1993 | set->queue_depth = BLK_MQ_MAX_DEPTH; | ||
1994 | } | ||
1984 | 1995 | ||
1985 | set->tags = kmalloc_node(set->nr_hw_queues * | 1996 | set->tags = kmalloc_node(set->nr_hw_queues * |
1986 | sizeof(struct blk_mq_tags *), | 1997 | sizeof(struct blk_mq_tags *), |