diff options
author | Jens Axboe <axboe@kernel.dk> | 2018-12-12 09:18:11 -0700 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-12-13 09:59:00 +0100 |
commit | cb5b7262b011cfb793519bf97e54dff5282da23c (patch) | |
tree | a038a3b479612f738979529be22391aab88501e5 /drivers/nvme/host/nvme.h | |
parent | 8eb5d89f483141dd076529bf5f6aa235b425886e (diff) |
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>
Diffstat (limited to 'drivers/nvme/host/nvme.h')
-rw-r--r-- | drivers/nvme/host/nvme.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index c78a9dc7fdcf..39b52f4d9b24 100644 --- a/drivers/nvme/host/nvme.h +++ b/drivers/nvme/host/nvme.h @@ -241,6 +241,9 @@ struct nvme_ctrl { u16 maxcmd; int nr_reconnects; struct nvmf_ctrl_options *opts; + + struct page *discard_page; + unsigned long discard_page_busy; }; struct nvme_subsystem { |