nvme: add support for streams and directives write-stream.4
authorJens Axboe <axboe@kernel.dk>
Thu, 15 Jun 2017 03:07:51 +0000 (21:07 -0600)
committerJens Axboe <axboe@fb.com>
Thu, 15 Jun 2017 03:43:55 +0000 (21:43 -0600)
commit46bc4e209de28542f4bdc9f327cc2845cf1d313c
tree1cd1fbf9e009eaf0b6ae2472b5cdb8d281a97b1c
parent61ee32ad0f4177f35192e8a2ce363730b9cbffd4
nvme: add support for streams and directives

This adds support for Directives in NVMe, particular for the Streams
directive. Support for Directives is a new feature in NVMe 1.3. It
allows a user to pass in information about where to store the data,
so that it the device can do so most effiently. If an application is
managing and writing data with different life times, mixing differently
retentioned data onto the same locations on flash can cause write
amplification to grow. This, in turn, will reduce performance and
life time of the device.

We default to allocating 4 streams per name space, but it is
configurable with the 'streams_per_ns' module option. If a write stream
is set in a write, flag is as such before sending it to the device. The
streams are allocated lazily - if we get a write request with a life
time hint, then background allocate streams and use them once that
is done.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/host/core.c
drivers/nvme/host/nvme.h
include/linux/nvme.h