]> git.baikalelectronics.ru Git - kernel.git/commit
nvme: provide fallback for discard alloc failure
authorJens Axboe <axboe@kernel.dk>
Wed, 12 Dec 2018 16:18:11 +0000 (09:18 -0700)
committerChristoph Hellwig <hch@lst.de>
Thu, 13 Dec 2018 08:59:00 +0000 (09:59 +0100)
commitb7ac31dbb406fc17547acea60a4eaa885b06a4eb
treea038a3b479612f738979529be22391aab88501e5
parent57edc37cf0beff68860b54c9858e9300b0a506fa
nvme: provide fallback for discard alloc failure

When boxes are run near (or to) OOM, we have a problem with the discard
page allocation in nvme. If we fail allocating the special page, we
return busy, and it'll get retried. But since ordering is honored for
dispatch requests, we can keep retrying this same IO and failing. Behind
that IO could be requests that want to free memory, but they never get
the chance.

Allocate a fixed discard page per controller for a safe fallback, and use
that if the initial allocation fails.

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