diff options
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r-- | block/blk-mq.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index 3b277b4eaa95..c5345a951820 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/cache.h> | 20 | #include <linux/cache.h> |
21 | #include <linux/sched/sysctl.h> | 21 | #include <linux/sched/sysctl.h> |
22 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
23 | #include <linux/crash_dump.h> | ||
23 | 24 | ||
24 | #include <trace/events/block.h> | 25 | #include <trace/events/block.h> |
25 | 26 | ||
@@ -1742,6 +1743,16 @@ struct request_queue *blk_mq_init_queue(struct blk_mq_tag_set *set) | |||
1742 | if (!ctx) | 1743 | if (!ctx) |
1743 | return ERR_PTR(-ENOMEM); | 1744 | return ERR_PTR(-ENOMEM); |
1744 | 1745 | ||
1746 | /* | ||
1747 | * If a crashdump is active, then we are potentially in a very | ||
1748 | * memory constrained environment. Limit us to 1 queue and | ||
1749 | * 64 tags to prevent using too much memory. | ||
1750 | */ | ||
1751 | if (is_kdump_kernel()) { | ||
1752 | set->nr_hw_queues = 1; | ||
1753 | set->queue_depth = min(64U, set->queue_depth); | ||
1754 | } | ||
1755 | |||
1745 | hctxs = kmalloc_node(set->nr_hw_queues * sizeof(*hctxs), GFP_KERNEL, | 1756 | hctxs = kmalloc_node(set->nr_hw_queues * sizeof(*hctxs), GFP_KERNEL, |
1746 | set->numa_node); | 1757 | set->numa_node); |
1747 | 1758 | ||