Spdk/lib/bdev
Jim Harris 94bc8cfdba bdev: add ENOMEM handling
At very high queue depths, bdev modules may not have enough
internal resources to track all of the incoming I/O.  For example,
we allocate a finite number of nvme_request objects per allocated
queue pair.  Currently if these resources are exhausted, the
bdev module will return failure (with no indication why) which
gets propagated all the way back to the application.

So instead, add SPDK_BDEV_IO_STATUS_NOMEM to allow bdev modules
to indicate this type of failure.  Also add handling for this
status type in the generic bdev layer, involving queuing these
I/O for later retry after other I/O on the failing channel have
completed.

This does place an expectation on the bdev module that these
internal resources are allocated per io_channel.  Otherwise we
cannot guarantee forward progress solely on reception of
completions.  For example, without this guarantee, a bdev
module could theoretically return ENOMEM even if there were
no I/O oustanding for that io_channel.  nvme, aio, rbd,
virtio and null drivers comply with this expectation already.
malloc only complies though when not using copy offload.

This patch will fix malloc w/ copy engine to at least
return ENOMEM when no copy descriptors are available.  If the
condition above occurs, I/O waiting for resources will get
failed as part of a subsequent reset which matches the
behavior it has today.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iea7cd51a611af8abe882794d0b2361fdbb74e84e

Reviewed-on: https://review.gerrithub.io/378853
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2017-10-01 21:57:00 -04:00
..
aio bdev: add ENOMEM handling 2017-10-01 21:57:00 -04:00
error bdev/error: use bdev_part helper functions 2017-09-12 11:16:50 -04:00
gpt gpt: fixed error-handling for vbdev_gpt_read_gpt 2017-09-25 16:53:52 -04:00
lvol bdev: allow allocating custom-length buffers for bdev_io 2017-09-28 17:08:34 -04:00
malloc bdev: add ENOMEM handling 2017-10-01 21:57:00 -04:00
null bdev/null: add Write Zeroes support 2017-09-25 16:31:49 -04:00
nvme bdev: add ENOMEM handling 2017-10-01 21:57:00 -04:00
pmem bdev_pmem: initial implementation of persistent memory bdev 2017-09-29 14:04:32 -04:00
rbd bdev: allow allocating custom-length buffers for bdev_io 2017-09-28 17:08:34 -04:00
rpc bdev: remove bdev_opened_for_write restriction 2017-09-20 14:43:32 -04:00
split bdev: add common partition helper functions 2017-09-12 11:16:50 -04:00
virtio rte_virtio: added virtio_dev_deinit 2017-09-29 13:02:09 -04:00
bdev.c bdev: add ENOMEM handling 2017-10-01 21:57:00 -04:00
Makefile bdev_pmem: initial implementation of persistent memory bdev 2017-09-29 14:04:32 -04:00
scsi_nvme.c nvme_spec: remove SGL Sub Type Invalid status code 2017-09-22 17:11:53 -04:00
vtune.c bdev: #include VTune file to control warnings 2017-06-08 12:44:25 -04:00