[PATCH 2/7] nvme: introduce a nvme_ns_ids structure

2017-11-09 Thread Christoph Hellwig
This allows us to manage the various uniqueue namespace identifiers together instead needing various variables and arguments. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Keith Busch <keith.bu...@intel.com> Reviewed-by: Sagi Grimberg <s...@grimberg.me> Reviewed-b

[PATCH 6/7] block: create 'slaves' and 'holders' entries for hidden gendisks

2017-11-09 Thread Christoph Hellwig
From: Hannes Reinecke <h...@suse.de> When creating nvme multipath devices we should populate the 'slaves' and 'holders' directorys properly to aid userspace topology detection. Signed-off-by: Hannes Reinecke <h...@suse.com> [hch: split from a larger patch] Signed-off-by: Christop

Re: [PATCH 4/5] nvme: implement multipath access to nvme subsystems

2017-11-09 Thread Christoph Hellwig
On Thu, Nov 09, 2017 at 04:44:32PM +0100, Hannes Reinecke wrote: > - We don't have the topology information in sysfs; We have all the topology information in sysfs, but you seem to look for the wrong thing. > while the namespace > device has the 'slaves' and 'holders' directories, they remain

Re: [PATCH 1/5] nvme: track subsystems

2017-11-09 Thread Christoph Hellwig
On Thu, Nov 09, 2017 at 01:33:16PM +0200, Sagi Grimberg wrote: > Any reason to do all this before we know if we found an existing subsystem? We'd either have to do all the initialization including the memory allocation and ida_simple_get under nvme_subsystems_lock, or search the list first, then

Re: [PATCH 3/5] nvme: track shared namespaces

2017-11-09 Thread Christoph Hellwig
On Thu, Nov 09, 2017 at 01:37:43PM +0200, Sagi Grimberg wrote: > >> To allow lockless path lookup the list of nvme_ns structures per >> nvme_ns_head is protected by SRCU, which requires freeing the nvme_ns >> structure through call_srcu. > > Can you remind me why isn't rcu sufficient? Can looking

Re: [PATCH 4/5] nvme: implement multipath access to nvme subsystems

2017-11-09 Thread Christoph Hellwig
On Wed, Nov 08, 2017 at 12:18:32PM +0100, Hannes Reinecke wrote: > On 11/08/2017 09:54 AM, Christoph Hellwig wrote: > > Can I get a review for this one? The only changes vs the previously > > reviewed versions is that we don't use the multipath code at all for > > s

Re: [PATCH V7 8/8] scsi: sd_zbc: Fix zone information initialization

2017-11-08 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig <h...@lst.de>

Re: [PATCH V7 7/8] scsi: sd: Remove zone write locking

2017-11-08 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig <h...@lst.de>

Re: [PATCH V7 6/8] scsi: sd_zbc: Initialize device request queue zoned data

2017-11-08 Thread Christoph Hellwig
A bit of duplication vs the existing ZBC code here, but it seems the old code is going away later in the series, so: Reviewed-by: Christoph Hellwig <h...@lst.de>

Re: [PATCH V7 5/8] block: deadline-iosched: Introduce zone locking support

2017-11-08 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig <h...@lst.de>

Re: [PATCH V7 4/8] block: deadline-iosched: Introduce dispatch helpers

2017-11-08 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig <h...@lst.de>

Re: [PATCH V7 3/8] block: mq-deadline: Introduce zone locking support

2017-11-08 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig <h...@lst.de>

Re: [PATCH V7 2/8] blokc: mq-deadline: Introduce dispatch helpers

2017-11-08 Thread Christoph Hellwig
Except for a bit of mis-spelling in the Subject this looks fine to me: Reviewed-by: Christoph Hellwig <h...@lst.de> FYI, I would just simplify the subject to mq-deadline: Introduce dispatch helpers and similar in the other patches.

Re: [PATCH v2] nvme: compare NQN string with right size

2017-11-08 Thread Christoph Hellwig
Thanks, applied both patches to nvme-4.15.

[PATCH] block: remove __bio_kmap_atomic

2017-11-08 Thread Christoph Hellwig
-by: Christoph Hellwig <h...@lst.de> --- Jens, this is on top of your bio_kmap_irq removal patch on the list. Documentation/block/biodoc.txt | 11 +-- arch/xtensa/platforms/iss/simdisk.c | 4 ++-- block/blk-settings.c| 2 +- include/linux/bio.h

Re: [dm-devel] [PATCH] bio: have bio_kmap_irq return the size of mapped data (fwd)

2017-11-08 Thread Christoph Hellwig
On Wed, Nov 08, 2017 at 11:08:13AM -0700, Jens Axboe wrote: > On 11/08/2017 11:03 AM, Christoph Hellwig wrote: > > On Wed, Nov 08, 2017 at 08:36:25AM -0700, Jens Axboe wrote: > >> On 11/08/2017 08:34 AM, Christoph Hellwig wrote: > >>> On Wed, Nov 08, 2017 at 08:2

Re: [dm-devel] [PATCH] bio: have bio_kmap_irq return the size of mapped data (fwd)

2017-11-08 Thread Christoph Hellwig
On Wed, Nov 08, 2017 at 08:36:25AM -0700, Jens Axboe wrote: > On 11/08/2017 08:34 AM, Christoph Hellwig wrote: > > On Wed, Nov 08, 2017 at 08:20:58AM -0700, Jens Axboe wrote: > >> On top of that, there are no users of it at all... > > > > But Mikulas wants to add one

Re: [dm-devel] [PATCH] bio: have bio_kmap_irq return the size of mapped data (fwd)

2017-11-08 Thread Christoph Hellwig
On Wed, Nov 08, 2017 at 08:20:58AM -0700, Jens Axboe wrote: > On top of that, there are no users of it at all... But Mikulas wants to add one :) Note that __bio_kmap_atomic has the same issues, only has a single users either and would be cleaner if opencoded there as it already has the current

Re: [PATCH] bio: have bio_kmap_irq return the size of mapped data (fwd)

2017-11-08 Thread Christoph Hellwig
On Wed, Nov 08, 2017 at 07:38:44AM -0500, Mikulas Patocka wrote: > > To be honest I think we should just remove bio_kmap_irq. It is currently > > unused and assumes there is only a single bvec to map. > > It could be removed from include/linux/bio.h and moved to my driver. But > if we leave it

Re: [PATCH] bio: have bio_kmap_irq return the size of mapped data (fwd)

2017-11-08 Thread Christoph Hellwig
On Tue, Nov 07, 2017 at 04:45:17PM -0500, Mikulas Patocka wrote: > Hi > > I need the function bio_kmap_irq in the driver that I am developing, but > it doesn't return the size of the mapped data. I've made this patch to fix > it. To be honest I think we should just remove bio_kmap_irq. It is

Re: [PATCH 4/5] nvme: implement multipath access to nvme subsystems

2017-11-08 Thread Christoph Hellwig
Can I get a review for this one? The only changes vs the previously reviewed versions is that we don't use the multipath code at all for subsystems that aren't multiported, and that there is an explicit opt-out at compile and module load time, so it shouldn't be that hard to review for those who

Re: [PATCH 3/3] nvme: fix eui_show() print format

2017-11-07 Thread Christoph Hellwig
On Sat, Nov 04, 2017 at 12:22:20PM +0100, Javier González wrote: > > Perhaps this should just become > > > > %8ph > > > > without D > > That would be ok with me. Can you resend a patch for that?

Re: [PATCH 1/3] nvme: do not check for ns on rw path

2017-11-06 Thread Christoph Hellwig
On Sat, Nov 04, 2017 at 09:38:45AM -0600, Keith Busch wrote: > That's not quite right. For non-PI metadata formats, we use the > 'nop_profile', which gets the metadata buffer allocated so we can safely > use a metadata formatted namespace. There's no in-kernel user of the > allocated payload, but

Re: [PATCH 1/3] nvme: do not check for ns on rw path

2017-11-04 Thread Christoph Hellwig
On Fri, Nov 03, 2017 at 09:02:04AM -0600, Keith Busch wrote: > If the namespace has metadata, but the request doesn't have a metadata > payload attached to it for whatever reason, we can't construct the command > for that format. We also can't have the controller strip/generate the > payload with

Re: [PATCH 3/3] nvme: fix eui_show() print format

2017-11-03 Thread Christoph Hellwig
On Fri, Nov 03, 2017 at 11:02:50AM +0100, Javier González wrote: > Signed-off-by: Javier González > --- > drivers/nvme/host/core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c > index

Re: [PATCH 2/3] nvme: compare NQN string with right size

2017-11-03 Thread Christoph Hellwig
On Fri, Nov 03, 2017 at 11:02:49AM +0100, Javier González wrote: > Compare subnqns using NVMF_NQN_SIZE as it is < 256 > > Signed-off-by: Javier González > --- > drivers/nvme/host/core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git

[GIT PULL] nvme updates for Linux 4.15

2017-11-03 Thread Christoph Hellwig
to a806c6c81e6c0d07c8a8b2643bad4a37a196d681: nvme: comment typo fixed in clearing AER (2017-11-03 10:02:20 +0300) Chaitanya Kulkarni (1): nvme-pci: add SGL support Christoph Hellwig (11): nvme: simplify compat_ioctl handling nvme: use

[PATCH 5/5] nvme: also expose the namespace identification sysfs files for mpath nodes

2017-11-02 Thread Christoph Hellwig
We do this by adding a helper that returns the ns_head for a device that can belong to either the per-controller or per-subsystem block device nodes, and otherwise reuse all the existing code. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Keith Busch <keith.bu...@intel.com&

[PATCH 7/7] block: add a poll_fn callback to struct request_queue

2017-11-02 Thread Christoph Hellwig
That we we can also poll non blk-mq queues. Mostly needed for the NVMe multipath code, but could also be useful elsewhere. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Hannes Reinecke <h...@suse.com> --- block/blk-core.c | 11 +++ bl

nvme multipath support V6

2017-11-02 Thread Christoph Hellwig
Hi all, this series adds support for multipathing, that is accessing nvme namespaces through multiple controllers to the nvme core driver. It is a very thin and efficient implementation that relies on close cooperation with other bits of the nvme driver, and few small and simple block helpers.

[PATCH 4/5] nvme: implement multipath access to nvme subsystems

2017-11-02 Thread Christoph Hellwig
it alive needs to be implemented at the controller level. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/nvme/host/Kconfig | 9 ++ drivers/nvme/host/Makefile| 1 + drivers/nvme/host/core.c | 133 +++--- drivers/nvme/host/multipath.c

[PATCH 2/5] nvme: introduce a nvme_ns_ids structure

2017-11-02 Thread Christoph Hellwig
This allows us to manage the various uniqueue namespace identifiers together instead needing various variables and arguments. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Keith Busch <keith.bu...@intel.com> Reviewed-by: Sagi Grimberg <s...@grimberg.me> Reviewed-b

[PATCH 3/5] nvme: track shared namespaces

2017-11-02 Thread Christoph Hellwig
. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Keith Busch <keith.bu...@intel.com> Reviewed-by: Javier González <jav...@cnexlabs.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> Reviewed-by: Hannes Reinecke <h...@suse.com> --- driv

[PATCH 6/7] block: introduce GENHD_FL_HIDDEN

2017-11-02 Thread Christoph Hellwig
With this flag a driver can create a gendisk that can be used for I/O submission inside the kernel, but which is not registered as user facing block device. This will be useful for the NVMe multipath implementation. Signed-off-by: Christoph Hellwig <h...@lst.de> --- block/genhd.c

[PATCH 1/5] nvme: track subsystems

2017-11-02 Thread Christoph Hellwig
Hannes Reinecke to expose the subsystems in sysfs. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Hannes Reinecke <h...@suse.com> --- drivers/nvme/host/core.c| 210 ++-- drivers/nvme/host/fabrics.c | 4 +- drivers/nvme

[PATCH 5/7] block: don't look at the struct device dev_t in disk_devt

2017-11-02 Thread Christoph Hellwig
into the struct device. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> Reviewed-by: Hannes Reinecke <h...@suse.com> --- block/genhd.c | 4 include/linux/genhd.h | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-)

[PATCH 4/7] block: add a blk_steal_bios helper

2017-11-02 Thread Christoph Hellwig
This helpers allows to bounce steal the uncompleted bios from a request so that they can be reissued on another path. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Sagi Grimberg <s...@grimberg.me> Reviewed-by: Hannes Reinecke <h...@suse.com> --- block/blk

[PATCH 2/7] block: add REQ_DRV bit

2017-11-02 Thread Christoph Hellwig
Set aside a bit in the request/bio flags for driver use. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Sagi Grimberg <s...@grimberg.me> Reviewed-by: Hannes Reinecke <h...@suse.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> --- include/linux/blk_t

[PATCH 3/7] block: provide a direct_make_request helper

2017-11-02 Thread Christoph Hellwig
This helper allows reinserting a bio into a new queue without much overhead, but requires all queue limits to be the same for the upper and lower queues, and it does not provide any recursion preventions. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Sagi Grimberg <s...@gr

block layer patches for nvme multipath support

2017-11-02 Thread Christoph Hellwig
Hi Jens, these patches add the block layer helpers / tweaks for NVMe multipath support. Can you review them for inclusion? There have been no functional changes to the versions posted with previous nvme multipath patchset.

[PATCH 1/7] block: move REQ_NOWAIT

2017-11-02 Thread Christoph Hellwig
This flag should be before the operation-specific REQ_NOUNMAP bit. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Sagi Grimberg <s...@grimberg.me> Reviewed-by: Hannes Reinecke <h...@suse.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> --- inclu

[PATCH 5/6] nvme: set the chunk size before freezing the queue

2017-11-02 Thread Christoph Hellwig
We don't need a frozen queue to update the chunk_size, which just is a hint, and moving it a little earlier will allow for some better code reuse with the multipath code. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/nvme/host/core.c | 5 +++-- 1 file changed, 3 insertions

[PATCH 6/6] nvme: split __nvme_revalidate_disk

2017-11-02 Thread Christoph Hellwig
Split out the code that applies the calculate value to a given disk/queue into new helper that can be reused by the multipath code. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/nvme/host/core.c | 49 +--- 1 file changed, 26 inse

[PATCH 2/6] nvme: always unregister the integrity profile in __nvme_revalidate_disk

2017-11-02 Thread Christoph Hellwig
This is safe because the queue is always frozen when we revalidate, and it simplifies both the existing code as well as the multipath implementation. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/nvme/host/core.c | 40 ++-- 1 file chang

[PATCH 1/6] nvme: move the dying queue check from cancel to completion

2017-11-02 Thread Christoph Hellwig
. Note that it applies to any command there and not just cancelled commands, but one the queue is dying that is the right thing to do anyway. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/nvme/host/core.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff

[PATCH 3/6] nvme: don't pass struct nvme_ns to nvme_init_integrity

2017-11-02 Thread Christoph Hellwig
To allow reusing this function for the multipath node. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/nvme/host/core.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index bc27f6

[PATCH 4/6] nvme: don't pass struct nvme_ns to nvme_config_discard

2017-11-02 Thread Christoph Hellwig
To allow reusing this function for the multipath node. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/nvme/host/core.c | 33 + 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c

nvme cleanups in preparation for the multipath code

2017-11-02 Thread Christoph Hellwig
Hi all, below are a couple cleanup patches to prepare for the next version of the nvme multipath code.

Re: [PATCH 16/17] nvme: implement multipath access to nvme subsystems

2017-11-02 Thread Christoph Hellwig
On Mon, Oct 30, 2017 at 11:37:55AM +0800, Guan Junxiong wrote: > > + head->disk->flags = GENHD_FL_EXT_DEVT; > > + sprintf(head->disk->disk_name, "nvme%dn%d", > > + ctrl->subsys->instance, nsid); > > Is it okay to use head->instance instead of nsid for disk name nvme#n# ? >

Re: [PATCH 06/17] block: introduce GENHD_FL_HIDDEN

2017-10-29 Thread Christoph Hellwig
On Sat, Oct 28, 2017 at 06:09:46PM +0800, Guan Junxiong wrote: > Does it mean some extra works such as: > 1) showing the path topology of nvme multipath device It's in sysfs. And Johannes volunteered to also add nvme-cli support. > 2) daemon to implement immediate and delayed failback The

Re: [PATCH 06/17] block: introduce GENHD_FL_HIDDEN

2017-10-28 Thread Christoph Hellwig
On Sat, Oct 28, 2017 at 03:20:07PM +0800, Guan Junxiong wrote: > Think of some current advanced features of DM-Multipath combined with > multipath-tools > such as path-latency priority grouping, intermittent IO error accounting for > path > degradation, delayed or immediate or follow-over

Re: [PATCH 06/17] block: introduce GENHD_FL_HIDDEN

2017-10-28 Thread Christoph Hellwig
On Tue, Oct 24, 2017 at 05:40:00PM -0400, Mike Snitzer wrote: > Having the NVme driver go to such lengths to hide its resources from > upper layers is certainly the work of an evil genius experiencing some > serious territorial issues. Not sugar-coating it.. you wouldn't. I'm pretty surre Hannes

Re: [PATCH 16/17] nvme: implement multipath access to nvme subsystems

2017-10-28 Thread Christoph Hellwig
> Sure this works? It does. > nvme_req_needs_retry() checks blk_noretry_request(): > The original idea here was to _set_ these bits on multipath path devices > so that they won't attempt any retry, but rather forward the I/O error > to the multipath device itself for failover. > So if these

Re: [PATCH 17/17] nvme: also expose the namespace identification sysfs files for mpath nodes

2017-10-28 Thread Christoph Hellwig
On Tue, Oct 24, 2017 at 09:45:44AM +0200, Hannes Reinecke wrote: > device_add_disk_with_groups()? > What happened to that proposal? Doesn't look like it got anywhere near a tree I could base this work on. And what happen to not fullquoting a patch for a two line comment?

Re: [PATCH 04/17] block: add a blk_steal_bios helper

2017-10-28 Thread Christoph Hellwig
On Tue, Oct 24, 2017 at 11:44:26AM +0300, Max Gurtovoy wrote: >> + * Steal bios from a request. The request must not have been partially >> + * completed before. >> + */ > > Maybe we can add to the comment that "list" is the destination for the > stolen bio. Sure. >> +void

Re: [PATCH v4] virtio_blk: Fix an SG_IO regression

2017-10-27 Thread Christoph Hellwig
e_rq(struct request *req) > +{ > + struct virtblk_req *vbr = blk_mq_rq_to_pdu(req); > + > +#ifdef CONFIG_VIRTIO_BLK_SCSI > + scsi_req_init(>sreq); > +#endif How about only defininig the initialize_rq method and implementation if CONFIG_VIRTIO_BLK_SCSI is set? Else looks good: Reviewed-by: Christoph Hellwig <h...@lst.de>

[GIT PULL] one nvme fix for 4.14

2017-10-27 Thread Christoph Hellwig
The following changes since commit f04b9cc87b5fc466b1b7231ba7b078e885956c5b: nvme-rdma: Fix error status return in tagset allocation failure (2017-10-19 17:13:51 +0200) are available in the git repository at: git://git.infradead.org/nvme.git nvme-4.14 for you to fetch changes up to

Re: [PATCH v2] block: fix peeking requests during PM

2017-10-24 Thread Christoph Hellwig
On Mon, Oct 23, 2017 at 06:43:16PM +0800, Ming Lei wrote: > On Fri, Oct 20, 2017 at 04:45:23PM +0200, Christoph Hellwig wrote: > > We need to look for an active PM request until the next softbarrier > > instead of looking for the first non-PM request. Otherwise any cause > >

Re: [PATCH 16/17] nvme: implement multipath access to nvme subsystems

2017-10-23 Thread Christoph Hellwig
On Mon, Oct 23, 2017 at 06:32:47PM +0300, Sagi Grimberg wrote: >> struct nvme_queue *nvmeq = hctx->driver_data; >> + printk_ratelimited("%s: called\n", __func__); >> + > > This must be a left-over... Indeed, it is a left-over debug statement..

[PATCH 01/17] block: move REQ_NOWAIT

2017-10-23 Thread Christoph Hellwig
This flag should be before the operation-specific REQ_NOUNMAP bit. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Sagi Grimberg <s...@grimberg.me> Reviewed-by: Hannes Reinecke <h...@suse.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> --- inclu

[PATCH 11/17] nvme: get rid of nvme_ctrl_list

2017-10-23 Thread Christoph Hellwig
device is called. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Sagi Grimberg <s...@grimberg.me> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/nvme/host/core.c | 76 ++-- drivers/nvme/host/nvme.h | 3 +- 2

[PATCH 12/17] nvme: check for a live controller in nvme_dev_open

2017-10-23 Thread Christoph Hellwig
This is a much more sensible check than just the admin queue. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Sagi Grimberg <s...@rimbeg.me> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/nvme/host/core.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 07/17] block: add a poll_fn callback to struct request_queue

2017-10-23 Thread Christoph Hellwig
That we we can also poll non blk-mq queues. Mostly needed for the NVMe multipath code, but could also be useful elsewhere. Signed-off-by: Christoph Hellwig <h...@lst.de> --- block/blk-core.c | 11 +++ block/blk-mq.c | 14 +- drivers/nvme/tar

[PATCH 09/17] nvme: simplify nvme_open

2017-10-23 Thread Christoph Hellwig
Now that we are protected against lookup vs free races for the namespace by using kref_get_unless_zero we don't need the hack of NULLing out the disk private data during removal. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Sagi Grimberg <s...@grimberg.me> Reviewed-

nvme multipath support V5

2017-10-23 Thread Christoph Hellwig
Hi all, this series adds support for multipathing, that is accessing nvme namespaces through multiple controllers to the nvme core driver. It is a very thin and efficient implementation that relies on close cooperation with other bits of the nvme driver, and few small and simple block helpers.

[PATCH 15/17] nvme: track shared namespaces

2017-10-23 Thread Christoph Hellwig
. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Keith Busch <keith.bu...@intel.com> Reviewed-by: Javier González <jav...@cnexlabs.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/nvme/host/core.c | 190 +

[PATCH 05/17] block: don't look at the struct device dev_t in disk_devt

2017-10-23 Thread Christoph Hellwig
into the struct device. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> --- block/genhd.c | 4 include/linux/genhd.h | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/block/genhd.c b/block/genhd.c index

[PATCH 17/17] nvme: also expose the namespace identification sysfs files for mpath nodes

2017-10-23 Thread Christoph Hellwig
We do this by adding a helper that returns the ns_head for a device that can belong to either the per-controller or per-subsystem block device nodes, and otherwise reuse all the existing code. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Keith Busch <keith.bu...@intel.com&

[PATCH 08/17] nvme: use kref_get_unless_zero in nvme_find_get_ns

2017-10-23 Thread Christoph Hellwig
For kref_get_unless_zero to protect against lookup vs free races we need to use it in all places where we aren't guaranteed to already hold a reference. There is no such guarantee in nvme_find_get_ns, so switch to kref_get_unless_zero in this function. Signed-off-by: Christoph Hellwig &l

[PATCH 10/17] nvme: switch controller refcounting to use struct device

2017-10-23 Thread Christoph Hellwig
pen file on the /dev/nvme-fabrics node has a refernece) when it is entered now, so we don't need to do the unless_zero variant there. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/nvme/host/core.c | 43 ++- drivers/nvme/host/fc.c

[PATCH 16/17] nvme: implement multipath access to nvme subsystems

2017-10-23 Thread Christoph Hellwig
it alive needs to be implemented at the controller level. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/nvme/host/core.c | 398 --- drivers/nvme/host/nvme.h | 15 +- drivers/nvme/host/pci.c | 2 + 3 files changed, 355 insertions(

[PATCH 14/17] nvme: introduce a nvme_ns_ids structure

2017-10-23 Thread Christoph Hellwig
This allows us to manage the various uniqueue namespace identifiers together instead needing various variables and arguments. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Keith Busch <keith.bu...@intel.com> Reviewed-by: Sagi Grimberg <s...@grimberg.me> --- driver

[PATCH 06/17] block: introduce GENHD_FL_HIDDEN

2017-10-23 Thread Christoph Hellwig
With this flag a driver can create a gendisk that can be used for I/O submission inside the kernel, but which is not registered as user facing block device. This will be useful for the NVMe multipath implementation. Signed-off-by: Christoph Hellwig <h...@lst.de> --- block/genhd.c

[PATCH 03/17] block: provide a direct_make_request helper

2017-10-23 Thread Christoph Hellwig
This helper allows reinserting a bio into a new queue without much overhead, but requires all queue limits to be the same for the upper and lower queues, and it does not provide any recursion preventions. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Sagi Grimberg <s...@gr

[PATCH 02/17] block: add REQ_DRV bit

2017-10-23 Thread Christoph Hellwig
Set aside a bit in the request/bio flags for driver use. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Sagi Grimberg <s...@grimberg.me> Reviewed-by: Hannes Reinecke <h...@suse.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> --- include/linux/blk_t

[PATCH 04/17] block: add a blk_steal_bios helper

2017-10-23 Thread Christoph Hellwig
This helpers allows to bounce steal the uncompleted bios from a request so that they can be reissued on another path. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Sagi Grimberg <s...@grimberg.me> --- block/blk-core.c | 20 include/linux/b

Re: [PATCH] blk-mq: Iterate also over sched_tags requests at blk_mq_tagset_iter()

2017-10-23 Thread Christoph Hellwig
On Mon, Oct 23, 2017 at 10:27:29AM +0300, Sagi Grimberg wrote: > Note that it does introduce a new spinlock to our hot-path, but given > the current over-allocation scheme with schedulers, its probably better > off. We could look into llists if it matters.

Re: [PATCH v2 4/4] lockdep: Assign a lock_class per gendisk used for wait_for_completion()

2017-10-23 Thread Christoph Hellwig
On Mon, Oct 23, 2017 at 08:53:35AM +0900, Byungchul Park wrote: > On Fri, Oct 20, 2017 at 07:44:51AM -0700, Christoph Hellwig wrote: > > The Subject prefix for this should be "block:". > > > > > @@ -945,7 +945,7 @@ int submit_bio_wait(struct bio *bio) > >

Re: [PATCH 9/9] bsg: split handling of SCSI CDBs vs transport requeues

2017-10-23 Thread Christoph Hellwig
On Mon, Oct 23, 2017 at 02:16:03AM -0400, Martin K. Petersen wrote: > > Benjamin, > > >> Not sure it's worth it especially now that Martin has merged the patch. > > > > He did? I only saw a mail that he picked patches 2-5. So all the bsg > > changes are still open I think. > > Yes, I expected

Re: [PATCH] blk-mq: Iterate also over sched_tags requests at blk_mq_tagset_iter()

2017-10-23 Thread Christoph Hellwig
On Sun, Oct 22, 2017 at 09:32:00PM +0300, Sagi Grimberg wrote: > >> Currently, blk_mq_tagset_iter() iterate over initial hctx tags only. >> In case scheduler is used, it doesn't iterate the hctx scheduler tags >> and the static request aren't been updated. >> For example, while using NVMe over

Re: [PATCH 9/9] bsg: split handling of SCSI CDBs vs transport requeues

2017-10-20 Thread Christoph Hellwig
On Thu, Oct 19, 2017 at 05:59:33PM +0200, Benjamin Block wrote: > > +#define ptr64(val) ((void __user *)(uintptr_t)(val)) > > Better to reflect the special property, that it is a user pointer, in > the name of the macro. Maybe something like user_ptr(64). The same > comment for the same macro in

[PATCH v2] block: fix peeking requests during PM

2017-10-20 Thread Christoph Hellwig
We need to look for an active PM request until the next softbarrier instead of looking for the first non-PM request. Otherwise any cause of request reordering might starve the PM request(s). Signed-off-by: Christoph Hellwig <h...@lst.de> --- block/blk-core.

Re: [PATCH v2 4/4] lockdep: Assign a lock_class per gendisk used for wait_for_completion()

2017-10-20 Thread Christoph Hellwig
1dd10e66e67b Mon Sep 17 00:00:00 2001 From: Christoph Hellwig <h...@lst.de> Date: Thu, 5 Oct 2017 18:31:02 +0200 Subject: block: use DECLARE_COMPLETION_ONSTACK in submit_bio_wait Simplify the code by getting rid of the submit_bio_ret structure. Signed-off-by: Christoph Hellwig <h...@lst.de

Re: [PATCH 07/17] nvme: use ida_simple_{get,remove} for the controller instance

2017-10-19 Thread Christoph Hellwig
On Thu, Oct 19, 2017 at 09:14:27AM -0600, Keith Busch wrote: > This is a good cleanup, and I'd support this patch going in ahead of > this series on its own if you want to apply to 4.15 immediately. Ok, will do.

Re: [PATCH 15/17] nvme: track shared namespaces

2017-10-19 Thread Christoph Hellwig
On Thu, Oct 19, 2017 at 02:06:07PM +0300, Sagi Grimberg wrote: > Christoph, > >> static void nvme_free_ns(struct kref *kref) >> { >> struct nvme_ns *ns = container_of(kref, struct nvme_ns, kref); >> + if (ns->head) >> +nvme_put_ns_head(ns->head); >> + > > When can we not

Re: [PATCH 10/17] nvme: switch controller refcounting to use struct device

2017-10-19 Thread Christoph Hellwig
On Thu, Oct 19, 2017 at 01:33:55PM +0300, Sagi Grimberg wrote: >> Well, the ctrl device integration is what enables us to do this. >> Before that the ctrl refcount could have reached null by the time >> we call the delete_ctrl method. > > OK, maybe a change log mention then? I thought I did that,

Re: [PATCH 03/17] block: provide a direct_make_request helper

2017-10-19 Thread Christoph Hellwig
On Thu, Oct 19, 2017 at 01:35:58PM +0300, Sagi Grimberg wrote: > >> +/** >> + * direct_make_request - hand a buffer directly to its device driver for I/O >> + * @bio: The bio describing the location in memory and on the device. >> + * >> + * This function behaves like generic_make_request(), but

Re: [PATCH 10/17] nvme: switch controller refcounting to use struct device

2017-10-19 Thread Christoph Hellwig
On Thu, Oct 19, 2017 at 01:02:59PM +0300, Sagi Grimberg wrote: >> By the time we call ->delete_ctrl in nvmf_create_ctrl we must still >> have that reference because we are still in a ->write call and thus >> ->release can't have been called yet. > > Thanks for the clarification. Is it worth a

Re: [PATCH 10/17] nvme: switch controller refcounting to use struct device

2017-10-19 Thread Christoph Hellwig
On Thu, Oct 19, 2017 at 10:31:20AM +0300, Sagi Grimberg wrote: > I don't think the fabrics device does not help us to keep the ctrl > allocated until we finish removal. All fabrics drivers grab an extra reference during ->create_ctrl, which we will drop when releasing the file descriptor that we

Re: [PATCH 11/17] nvme: get rid of nvme_ctrl_list

2017-10-19 Thread Christoph Hellwig
On Thu, Oct 19, 2017 at 09:22:09AM +0200, Johannes Thumshirn wrote: > I'm not sure if the removel of the major number module_param is good > from an ABI POV. This could lead to some unexpected results for those > poor souls that used it. It's a completely broken interface, so I have no pity for

Re: [PATCH 10/17] nvme: switch controller refcounting to use struct device

2017-10-19 Thread Christoph Hellwig
On Thu, Oct 19, 2017 at 10:17:01AM +0300, Sagi Grimberg wrote: > > >> -if (!kref_get_unless_zero(>ctrl.kref)) >> -return -EBUSY; >> +nvme_get_ctrl(>ctrl); > > Given that we take this reference before we are protected with > the state change I think this should still be

Re: [PATCH 13/17] nvme: track subsystems

2017-10-19 Thread Christoph Hellwig
> I'm having some trouble with this one. The device_initialize() initializes > the kobj's reference counter, and then the device_add() takes another > reference on it. > > The teardown, though, only calls put_device(). Where's the call to > device_del() supposed to go that ultimately drops the

[PATCH 17/17] nvme: also expose the namespace identification sysfs files for mpath nodes

2017-10-18 Thread Christoph Hellwig
We do this by adding a helper that returns the ns_head for a device that can belong to either the per-controller or per-subsystem block device nodes, and otherwise reuse all the existing code. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Keith Busch <keith.bu...@

[PATCH 13/17] nvme: track subsystems

2017-10-18 Thread Christoph Hellwig
Hannes Reinecke to expose the subsystems in sysfs. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/nvme/host/core.c| 179 +--- drivers/nvme/host/fabrics.c | 4 +- drivers/nvme/host/nvme.h| 20 +++-- 3 files changed, 167 inse

[PATCH 14/17] nvme: introduce a nvme_ns_ids structure

2017-10-18 Thread Christoph Hellwig
This allows us to manage the various uniqueue namespace identifiers together instead needing various variables and arguments. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Keith Busch <keith.bu...@intel.com> Reviewed-by: Sagi Grimberg <s...@grimberg.me> --- driver

[PATCH 12/17] nvme: check for a live controller in nvme_dev_open

2017-10-18 Thread Christoph Hellwig
This is a much more sensible check than just the admin queue. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/nvme/host/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 3757f5695de2..d490ab

[PATCH 15/17] nvme: track shared namespaces

2017-10-18 Thread Christoph Hellwig
. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Keith Busch <keith.bu...@intel.com> --- drivers/nvme/host/core.c | 192 +-- drivers/nvme/host/lightnvm.c | 14 ++-- drivers/nvme/host/nvme.h | 21 - 3 files changed, 19

[PATCH 16/17] nvme: implement multipath access to nvme subsystems

2017-10-18 Thread Christoph Hellwig
it alive needs to be implemented at the controller level. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/nvme/host/core.c | 369 --- drivers/nvme/host/nvme.h | 16 +- 2 files changed, 333 insertions(+), 52 deletions(-) diff --git a/d

[PATCH 03/17] block: provide a direct_make_request helper

2017-10-18 Thread Christoph Hellwig
This helper allows reinserting a bio into a new queue without much overhead, but requires all queue limits to be the same for the upper and lower queues, and it does not provide any recursion preventions. Signed-off-by: Christoph Hellwig <h...@lst.de> --- block/blk-core.c

[PATCH 04/17] block: add a blk_steal_bios helper

2017-10-18 Thread Christoph Hellwig
This helpers allows to bounce steal the uncompleted bios from a request so that they can be reissued on another path. Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Sagi Grimberg <s...@grimberg.me> --- block/blk-core.c | 20 include/linux/b

<    4   5   6   7   8   9   10   11   12   13   >