Re: [PATCH 11/11] nvme: add support for streams and directives

2017-06-19 Thread Jens Axboe
On 06/19/2017 12:53 PM, Christoph Hellwig wrote: > On Mon, Jun 19, 2017 at 08:53:08AM -0600, Jens Axboe wrote: >> Looking at it a bit more closely - there's a difference between >> assigning X number of streams (allocating) for use by the subsystem or >> per-ns, and having to manually open them.

Re: [PATCH 11/11] nvme: add support for streams and directives

2017-06-19 Thread Christoph Hellwig
On Mon, Jun 19, 2017 at 08:53:08AM -0600, Jens Axboe wrote: > Looking at it a bit more closely - there's a difference between > assigning X number of streams (allocating) for use by the subsystem or > per-ns, and having to manually open them. So I don't necessarily think > there's a problem here,

Re: [PATCH 11/11] nvme: add support for streams and directives

2017-06-19 Thread Jens Axboe
On 06/19/2017 12:35 AM, Christoph Hellwig wrote: > Can you add linux-nvme for the next repost? > > As said before I think we should rely on implicit streams allocation, > as that will make the whole patch a lot simpler, and it solves the issue > that your current patch will take away your 4

Re: [PATCH 11/11] nvme: add support for streams and directives

2017-06-19 Thread Jens Axboe
On 06/19/2017 12:25 AM, Christoph Hellwig wrote: > On Sat, Jun 17, 2017 at 09:11:30AM -0600, Jens Axboe wrote: >> I have two samples here, and I just tested, and both of them want it >> assigned with nsid=0x or they will fail the writes... So I'd say >> we're better off ensuring we do

Re: [PATCH 11/11] nvme: add support for streams and directives

2017-06-19 Thread Christoph Hellwig
Can you add linux-nvme for the next repost? As said before I think we should rely on implicit streams allocation, as that will make the whole patch a lot simpler, and it solves the issue that your current patch will take away your 4 streams from the general pool on every controller that supports

Re: [PATCH 11/11] nvme: add support for streams and directives

2017-06-19 Thread Christoph Hellwig
On Sat, Jun 17, 2017 at 09:11:30AM -0600, Jens Axboe wrote: > I have two samples here, and I just tested, and both of them want it > assigned with nsid=0x or they will fail the writes... So I'd say > we're better off ensuring we do allocate them globally. That's clearly against the spec.

[PATCH 11/11] nvme: add support for streams and directives

2017-06-17 Thread Jens Axboe
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

Re: [PATCH 11/11] nvme: add support for streams and directives

2017-06-17 Thread Jens Axboe
On 06/17/2017 09:11 AM, Jens Axboe wrote: > On 06/17/2017 09:03 AM, Christoph Hellwig wrote: >> On Sat, Jun 17, 2017 at 08:20:01AM -0600, Jens Axboe wrote: >>> We can certainly go that route. So you'd be fine with allocating 4 >>> streams controller wide by default, and dump the lazy alloc? We can

Re: [PATCH 11/11] nvme: add support for streams and directives

2017-06-17 Thread Jens Axboe
On 06/17/2017 09:03 AM, Christoph Hellwig wrote: > On Sat, Jun 17, 2017 at 08:20:01AM -0600, Jens Axboe wrote: >> We can certainly go that route. So you'd be fine with allocating 4 >> streams controller wide by default, and dump the lazy alloc? We can make >> this depend on the streams module

Re: [PATCH 11/11] nvme: add support for streams and directives

2017-06-17 Thread Christoph Hellwig
On Sat, Jun 17, 2017 at 08:20:01AM -0600, Jens Axboe wrote: > We can certainly go that route. So you'd be fine with allocating 4 > streams controller wide by default, and dump the lazy alloc? We can make > this depend on the streams module parameter, so people could turn it > off, if needed. We

Re: [PATCH 11/11] nvme: add support for streams and directives

2017-06-17 Thread Christoph Hellwig
On Fri, Jun 16, 2017 at 01:41:36PM -0600, Jens Axboe wrote: > But honestly, I simply don't care too much about it, for a few reasons: > > 1) I don't know of anyone that uses name spaces to split up a device, >except for places where the want integrity on one and not the other. >And I

Re: [PATCH 11/11] nvme: add support for streams and directives

2017-06-16 Thread Jens Axboe
On 06/16/2017 12:09 PM, Christoph Hellwig wrote: >> We default to allocating 4 streams per name space, but it is >> configurable with the 'streams_per_ns' module option. > > What's your strategy for multi-namespace devices? You won't even get > your 4 streams for a handful namespaces with

Re: [PATCH 11/11] nvme: add support for streams and directives

2017-06-16 Thread Christoph Hellwig
> We default to allocating 4 streams per name space, but it is > configurable with the 'streams_per_ns' module option. What's your strategy for multi-namespace devices? You won't even get your 4 streams for a handful namespaces with devices today or the near future. Should we cut down the

[PATCH 11/11] nvme: add support for streams and directives

2017-06-16 Thread Jens Axboe
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

Re: [PATCH 11/11] nvme: add support for streams and directives

2017-06-14 Thread Jens Axboe
On 06/14/2017 02:32 PM, Christoph Hellwig wrote: >> +static unsigned int nvme_get_write_stream(struct nvme_ns *ns, >> + struct request *req) >> +{ >> +unsigned int streamid = 0; >> + >> +if (req_op(req) != REQ_OP_WRITE ||

Re: [PATCH 11/11] nvme: add support for streams and directives

2017-06-14 Thread Christoph Hellwig
> +static unsigned int nvme_get_write_stream(struct nvme_ns *ns, > + struct request *req) > +{ > + unsigned int streamid = 0; > + > + if (req_op(req) != REQ_OP_WRITE || !blk_stream_valid(req->cmd_flags) || > + !ns->nr_streams) > +

[PATCH 11/11] nvme: add support for streams and directives

2017-06-14 Thread Jens Axboe
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

Re: [PATCH 11/11] nvme: add support for streams and directives

2017-06-13 Thread Jens Axboe
On 06/13/2017 03:12 PM, Andreas Dilger wrote: >> +static int nvme_streams_params(struct nvme_ns *ns) >> +{ >> +struct nvme_ctrl *ctrl = ns->ctrl; >> +struct streams_directive_params s; >> +struct nvme_command c; >> +int ret; >> + >> +memset(, 0, sizeof(c)); >> +memset(, 0,

Re: [PATCH 11/11] nvme: add support for streams and directives

2017-06-13 Thread Andreas Dilger
On Jun 13, 2017, at 11:15 AM, Jens Axboe wrote: > This adds support for Directives in NVMe, particular for the Streams > directive. 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

Re: [PATCH 11/11] nvme: add support for streams and directives

2017-06-13 Thread Jens Axboe
On 06/13/2017 01:47 PM, Andreas Dilger wrote: > On Jun 13, 2017, at 11:15 AM, Jens Axboe wrote: >> >> This adds support for Directives in NVMe, particular for the Streams >> directive. We default to allocating 4 streams per name space, but >> it is configurable with the

Re: [PATCH 11/11] nvme: add support for streams and directives

2017-06-13 Thread Andreas Dilger
On Jun 13, 2017, at 11:15 AM, Jens Axboe wrote: > > This adds support for Directives in NVMe, particular for the Streams > directive. 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