diff options
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-mq.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index 27a347fe8f5b..4854e709aa34 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
@@ -1804,16 +1804,6 @@ struct request_queue *blk_mq_init_queue(struct blk_mq_tag_set *set) | |||
1804 | if (!ctx) | 1804 | if (!ctx) |
1805 | return ERR_PTR(-ENOMEM); | 1805 | return ERR_PTR(-ENOMEM); |
1806 | 1806 | ||
1807 | /* | ||
1808 | * If a crashdump is active, then we are potentially in a very | ||
1809 | * memory constrained environment. Limit us to 1 queue and | ||
1810 | * 64 tags to prevent using too much memory. | ||
1811 | */ | ||
1812 | if (is_kdump_kernel()) { | ||
1813 | set->nr_hw_queues = 1; | ||
1814 | set->queue_depth = min(64U, set->queue_depth); | ||
1815 | } | ||
1816 | |||
1817 | hctxs = kmalloc_node(set->nr_hw_queues * sizeof(*hctxs), GFP_KERNEL, | 1807 | hctxs = kmalloc_node(set->nr_hw_queues * sizeof(*hctxs), GFP_KERNEL, |
1818 | set->numa_node); | 1808 | set->numa_node); |
1819 | 1809 | ||
@@ -2070,6 +2060,16 @@ int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set) | |||
2070 | set->queue_depth = BLK_MQ_MAX_DEPTH; | 2060 | set->queue_depth = BLK_MQ_MAX_DEPTH; |
2071 | } | 2061 | } |
2072 | 2062 | ||
2063 | /* | ||
2064 | * If a crashdump is active, then we are potentially in a very | ||
2065 | * memory constrained environment. Limit us to 1 queue and | ||
2066 | * 64 tags to prevent using too much memory. | ||
2067 | */ | ||
2068 | if (is_kdump_kernel()) { | ||
2069 | set->nr_hw_queues = 1; | ||
2070 | set->queue_depth = min(64U, set->queue_depth); | ||
2071 | } | ||
2072 | |||
2073 | set->tags = kmalloc_node(set->nr_hw_queues * | 2073 | set->tags = kmalloc_node(set->nr_hw_queues * |
2074 | sizeof(struct blk_mq_tags *), | 2074 | sizeof(struct blk_mq_tags *), |
2075 | GFP_KERNEL, set->numa_node); | 2075 | GFP_KERNEL, set->numa_node); |