]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-pci: limit max IO size and segments to avoid high order allocations
authorJens Axboe <axboe@kernel.dk>
Thu, 21 Jun 2018 15:49:37 +0000 (09:49 -0600)
committerChristoph Hellwig <hch@lst.de>
Thu, 21 Jun 2018 16:59:46 +0000 (18:59 +0200)
commita1b0961a6b53c9ab7dd972b12441830bca65fc93
tree9122de26af304afdf313020e689e9e4008de375c
parent6c3d0e4bd731d106d4a5b72c50f5ffd7b5937f47
nvme-pci: limit max IO size and segments to avoid high order allocations

nvme requires an sg table allocation for each request. If the request
is large, then the allocation can become quite large. For instance,
with our default software settings of 1280KB IO size, we'll need
10248 bytes of sg table. That turns into a 2nd order allocation,
which we can't always guarantee. If we fail the allocation, blk-mq
will retry it later. But there's no guarantee that we'll EVER be
able to allocate that much contigious memory.

Limit the IO size such that we never need more than a single page
of memory. That's a lot faster and more reliable. Then back that
allocation with a mempool, so that we know we'll always be able
to succeed the allocation at some point.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Acked-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/core.c
drivers/nvme/host/nvme.h
drivers/nvme/host/pci.c