numam-spdk/lib
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
..
bdev bdev: add ENOMEM handling 2017-10-01 21:57:00 -04:00
blob blob_bdev: hotremove support 2017-09-28 12:46:18 -04:00
blobfs blobfs: Make the behaviour of "delete file" as unlink. 2017-09-15 17:13:14 -04:00
conf log: Use SPDK_ERRLOG in lieu of fprintf(stderr 2017-05-09 11:28:28 -07:00
copy copy: return 0 on success and appropriate errno on failure 2017-09-25 13:56:29 -04:00
cunit include: Move the remainder of the code base to stdinc.h 2017-05-08 13:20:36 -07:00
env_dpdk env: add pci_virtio.c 2017-09-26 14:28:24 -04:00
event reactor: add context_switch_monitor RPC 2017-09-01 12:46:18 -04:00
ioat copy: return 0 on success and appropriate errno on failure 2017-09-25 13:56:29 -04:00
iscsi iscsi: fix layout of logout request reason field 2017-09-22 16:11:11 -04:00
json json: add function to write UTF-16LE strings 2017-07-12 18:12:52 -04:00
jsonrpc log: rename SPDK_TRACELOG to SPDK_DEBUGLOG 2017-08-29 13:25:58 -04:00
log log: add new parm to spdk_trace_dump() 2017-09-06 17:33:03 -04:00
lvol lvol: fix incorrect assumption of 1MiB cluster_size 2017-09-27 17:27:13 -04:00
nbd nbd, nvmf: fix clang 4.0 packed member warnings 2017-09-07 12:15:45 -04:00
net log: remove uses of SPDK_TRACE_DEBUG 2017-08-29 15:07:13 -04:00
nvme nvme: add controller option to specify host ID 2017-09-29 11:43:25 -04:00
nvmf nvmf: simplify spdk_nvmf_request_exec() 2017-09-29 13:03:24 -04:00
rocksdb blob_bdev: hotremove support 2017-09-28 12:46:18 -04:00
rpc rpc: add get_rpc_methods RPC call 2017-08-01 13:43:14 -04:00
scsi Revert "scsi: remove LUN I/O channel ref counting" 2017-09-26 18:44:55 -04:00
trace lib: replace strerror with strerror_r 2017-08-15 16:47:01 -04:00
ut_mock test/mock: add pthread_self 2017-09-19 17:15:15 -04:00
util blob: defer calling unload callback until dev is destroyed 2017-09-26 19:10:28 -04:00
vhost vhost_scsi: remove entire device on LUN hotremove 2017-09-29 11:43:50 -04:00
Makefile lvol: Logical volume implementation 2017-09-14 19:30:54 -04:00