linux/drivers/nvme/host
Helen Koike f9f38e3338 nvme: improve performance for virtual NVMe devices
This change provides a mechanism to reduce the number of MMIO doorbell
writes for the NVMe driver. When running in a virtualized environment
like QEMU, the cost of an MMIO is quite hefy here. The main idea for
the patch is provide the device two memory location locations:
 1) to store the doorbell values so they can be lookup without the doorbell
    MMIO write
 2) to store an event index.
I believe the doorbell value is obvious, the event index not so much.
Similar to the virtio specification, the virtual device can tell the
driver (guest OS) not to write MMIO unless you are writing past this
value.

FYI: doorbell values are written by the nvme driver (guest OS) and the
event index is written by the virtual device (host OS).

The patch implements a new admin command that will communicate where
these two memory locations reside. If the command fails, the nvme
driver will work as before without any optimizations.

Contributions:
  Eric Northup <digitaleric@google.com>
  Frank Swiderski <fes@google.com>
  Ted Tso <tytso@mit.edu>
  Keith Busch <keith.busch@intel.com>

Just to give an idea on the performance boost with the vendor
extension: Running fio [1], a stock NVMe driver I get about 200K read
IOPs with my vendor patch I get about 1000K read IOPs. This was
running with a null device i.e. the backing device simply returned
success on every read IO request.

[1] Running on a 4 core machine:
  fio --time_based --name=benchmark --runtime=30
  --filename=/dev/nvme0n1 --nrfiles=1 --ioengine=libaio --iodepth=32
  --direct=1 --invalidate=1 --verify=0 --verify_fatal=0 --numjobs=4
  --rw=randread --blocksize=4k --randrepeat=false

Signed-off-by: Rob Nelson <rlnelson@google.com>
[mlin: port for upstream]
Signed-off-by: Ming Lin <mlin@kernel.org>
[koike: updated for upstream]
Signed-off-by: Helen Koike <helen.koike@collabora.co.uk>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <keith.busch@intel.com>
2017-04-21 16:41:47 +02:00
..
core.c blk-mq: remove the error argument to blk_mq_complete_request 2017-04-20 12:16:10 -06:00
fabrics.c nvme-fabrics: Allow ctrl loss timeout configuration 2017-04-04 09:48:23 -06:00
fabrics.h nvme-fabrics: Allow ctrl loss timeout configuration 2017-04-04 09:48:23 -06:00
fc.c nvme: split nvme status from block req->errors 2017-04-20 12:16:10 -06:00
Kconfig nvme-fabrics: Add host support for FC transport 2016-12-06 10:17:56 +02:00
lightnvm.c nvme: make nvme_error_status private 2017-04-20 12:16:10 -06:00
Makefile nvme-fabrics: Add host support for FC transport 2016-12-06 10:17:56 +02:00
nvme.h blk-mq: remove the error argument to blk_mq_complete_request 2017-04-20 12:16:10 -06:00
pci.c nvme: improve performance for virtual NVMe devices 2017-04-21 16:41:47 +02:00
rdma.c nvme: split nvme status from block req->errors 2017-04-20 12:16:10 -06:00
scsi.c nvme/scsi: don't rely on BLK_MAX_CDB 2017-01-30 08:33:51 -07:00