NVMe: Short-cut removal on surprise hot-unplug
authorKeith Busch <keith.busch@intel.com>
Thu, 12 May 2016 14:37:14 +0000 (08:37 -0600)
committerJens Axboe <axboe@fb.com>
Tue, 17 May 2016 23:14:21 +0000 (17:14 -0600)
commit0ff9d4e1a284a9282a049bf064f123e27f838907
treed37ba94c22fb1039c6e25f51f0479ec5afa3f72a
parent9ec3bb2f994bda9c8817856fdcbfaebe8f62fbd3
NVMe: Short-cut removal on surprise hot-unplug

This patch adds a new state that when set has the core automatically
kill request queues prior to removing namespaces.

If PCI device is not present at the time the nvme driver's remove is
called, we can kill all IO queues immediately instead of waiting for
the watchdog thread to do that at its polling interval. This improves
scenarios where multiple hot plug events occur at the same time since
it doesn't block the pci enumeration for as long.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/nvme/host/core.c
drivers/nvme/host/nvme.h
drivers/nvme/host/pci.c