blk-mq: limit memory consumption if a crash dump is active
authorJens Axboe <axboe@fb.com>
Wed, 17 Sep 2014 14:27:03 +0000 (08:27 -0600)
committerJens Axboe <axboe@fb.com>
Mon, 30 Mar 2015 18:54:55 +0000 (12:54 -0600)
commitfccefb687af3e1683451fcee5be3acf19140d71f
treeb07bbea23c1c5d0d2a7e4856210c05a73d962c0a
parent1bbc83526a843f20e186d1ed99d6d91fd54df488
blk-mq: limit memory consumption if a crash dump is active

It's not uncommon for crash dump kernels to be limited to 128MB or
something low in that area. This is normally not a problem for
devices as we don't use that much memory, but for some shared SCSI
setups with huge queue depths, it can potentially fill most of
memory with tons of request allocations. blk-mq does scale back
when it fails to allocate memory, but it scales back just enough
so that blk-mq succeeds. This could still leave the system with
not enough memory to make any real progress.

Check if we are in a kdump environment and limit the hardware
queues and tag depth.

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