Re: [PATCH V2 0/2] block: remove unnecessary RESTART

2017-11-02 Thread Ming Lei
On Fri, Nov 03, 2017 at 02:42:50AM +, Bart Van Assche wrote: > On Fri, 2017-11-03 at 10:12 +0800, Ming Lei wrote: > > [root@ibclient srp-test]# ./run_tests > > modprobe: FATAL: Module target_core_mod is in use. > > LIO must be unloaded before srp-test software is started. Yeah, I can make

Re: [PATCH V2 0/2] block: remove unnecessary RESTART

2017-11-02 Thread Bart Van Assche
On Fri, 2017-11-03 at 10:12 +0800, Ming Lei wrote: > [root@ibclient srp-test]# ./run_tests > modprobe: FATAL: Module target_core_mod is in use. LIO must be unloaded before srp-test software is started. Bart.

Re: [PATCH V2 0/2] block: remove unnecessary RESTART

2017-11-02 Thread Ming Lei
Hi Laurence, On Thu, Nov 02, 2017 at 09:16:04PM -0400, Laurence Oberman wrote: > Hi Ming > I have used Bart's tests on my test bed they should run fine. > Are you using my SRP setup. Yeah, I am using your SRP setup. Once the three directories are created, I saw the new failure, and both ib/srp

Re: [PATCH V2 0/2] block: remove unnecessary RESTART

2017-11-02 Thread Bart Van Assche
On Fri, 2017-11-03 at 08:15 +0800, Ming Lei wrote: > On Thu, Nov 02, 2017 at 11:54:57PM +, Bart Van Assche wrote: > > On Fri, 2017-11-03 at 07:48 +0800, Ming Lei wrote: > > > Could you please share your srp-tests script? I may find a IB/SRP system > > > to see if I can reproduce this issue and

Re: [PATCH V2 0/2] block: remove unnecessary RESTART

2017-11-02 Thread Ming Lei
On Thu, Nov 02, 2017 at 11:54:57PM +, Bart Van Assche wrote: > On Fri, 2017-11-03 at 07:48 +0800, Ming Lei wrote: > > Could you please share your srp-tests script? I may find a IB/SRP system > > to see if I can reproduce this issue and figure out one solution. > > Please have a look at

Re: [PATCH V2 0/2] block: remove unnecessary RESTART

2017-11-02 Thread Bart Van Assche
On Fri, 2017-11-03 at 07:48 +0800, Ming Lei wrote: > Could you please share your srp-tests script? I may find a IB/SRP system > to see if I can reproduce this issue and figure out one solution. Please have a look at https://github.com/bvanassche/srp-test. Bart.

Re: [PATCH V2 0/2] block: remove unnecessary RESTART

2017-11-02 Thread Ming Lei
On Thu, Nov 02, 2017 at 11:43:55PM +, Bart Van Assche wrote: > On Fri, 2017-11-03 at 07:38 +0800, Ming Lei wrote: > > On Thu, Nov 02, 2017 at 03:57:05PM +, Bart Van Assche wrote: > > > On Wed, 2017-11-01 at 08:21 -0600, Jens Axboe wrote: > > > > Fixed that up, and applied these two patches

Re: [PATCH V2 0/2] block: remove unnecessary RESTART

2017-11-02 Thread Bart Van Assche
On Fri, 2017-11-03 at 07:38 +0800, Ming Lei wrote: > On Thu, Nov 02, 2017 at 03:57:05PM +, Bart Van Assche wrote: > > On Wed, 2017-11-01 at 08:21 -0600, Jens Axboe wrote: > > > Fixed that up, and applied these two patches as well. > > > > Hello Jens, > > > > Recently I noticed that a test

Re: [PATCH V2 0/2] block: remove unnecessary RESTART

2017-11-02 Thread Ming Lei
On Thu, Nov 02, 2017 at 03:57:05PM +, Bart Van Assche wrote: > On Wed, 2017-11-01 at 08:21 -0600, Jens Axboe wrote: > > Fixed that up, and applied these two patches as well. > > Hello Jens, > > Recently I noticed that a test system sporadically hangs during boot (Dell > PowerEdge R720 that

[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 Reviewed-by: Keith Busch

[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 Reviewed-by: Hannes Reinecke --- block/blk-core.c | 11 +++ block/blk-mq.c

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
This patch adds native multipath support to the nvme driver. For each namespace we create only single block device node, which can be used to access that namespace through any of the controllers that refer to it. The gendisk for each controllers path to the name space still exists inside the

[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 Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Reviewed-by: Hannes Reinecke

[PATCH 3/5] nvme: track shared namespaces

2017-11-02 Thread Christoph Hellwig
Introduce a new struct nvme_ns_head that holds information about an actual namespace, unlike struct nvme_ns, which only holds the per-controller namespace information. For private namespaces there is a 1:1 relation of the two, but for shared namespaces this lets us discover all the paths to it.

[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 --- block/genhd.c | 68

[PATCH 1/5] nvme: track subsystems

2017-11-02 Thread Christoph Hellwig
This adds a new nvme_subsystem structure so that we can track multiple controllers that belong to a single subsystem. For now we only use it to store the NQN, and to check that we don't have duplicate NQNs unless the involved subsystems support multiple controllers. Includes code originally from

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

2017-11-02 Thread Christoph Hellwig
The hidden gendisks introduced in the next patch need to keep the dev field in their struct device empty so that udev won't try to create block device nodes for them. To support that rewrite disk_devt to look at the major and first_minor fields in the gendisk itself instead of looking into the

[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 Reviewed-by: Sagi Grimberg Reviewed-by: Hannes Reinecke --- block/blk-core.c | 21

[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 Reviewed-by: Sagi Grimberg Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn --- include/linux/blk_types.h | 5 + 1 file

[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 Reviewed-by: Sagi Grimberg

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 Reviewed-by: Sagi Grimberg Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn --- include/linux/blk_types.h | 4 ++--

[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 --- drivers/nvme/host/core.c | 5 +++-- 1 file changed, 3 insertions(+), 2

[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 --- drivers/nvme/host/core.c | 49 +--- 1 file changed, 26 insertions(+),

[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 --- drivers/nvme/host/core.c | 40 ++-- 1 file changed, 10

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

2017-11-02 Thread Christoph Hellwig
With multipath we don't want a hard DNR bit on a request that is cancelled by a controller reset, but instead want to be able to retry it on another patch. To archive this don't always set the DNR bit when the queue is dying in nvme_cancel_request, but defer that decision to nvme_req_needs_retry.

[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 --- 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

[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 --- 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 index

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] bcache: add a comment in journal bucket reading

2017-11-02 Thread Michael Lyle
Tang-- On 11/01/2017 08:08 PM, tang.jun...@zte.com.cn wrote: > From: Tang Junhui > > Journal bucket is a circular buffer, the bucket > can be like YYYNNNYY, which means the first valid journal in > the 7th bucket, and the latest valid journal in third bucket, in > this

Re: [PATCH V2 0/2] block: remove unnecessary RESTART

2017-11-02 Thread Bart Van Assche
On Wed, 2017-11-01 at 08:21 -0600, Jens Axboe wrote: > Fixed that up, and applied these two patches as well. Hello Jens, Recently I noticed that a test system sporadically hangs during boot (Dell PowerEdge R720 that boots from a hard disk connected to a MegaRAID SAS adapter) and also that

[PATCH V3 0/7] blk-mq: don't allocate driver tag beforehand for flush rq

2017-11-02 Thread Ming Lei
Hi Jens, This patchset avoids to allocate driver tag beforehand for flush rq in case of I/O scheduler, then flush rq isn't treated specially wrt. get/put driver tag, code gets cleanup much, such as, reorder_tags_to_front() is removed, and we needn't to worry about request order in dispatch list

[PATCH V3 1/7] blk-mq: put the driver tag of nxt rq before first one is requeued

2017-11-02 Thread Ming Lei
From: Jianchao Wang When free the driver tag of the next rq with I/O scheduler configured, it get the first entry of the list, however, at the moment, the failed rq has been requeued at the head of the list. The rq it gets is the failed rq not the next rq. Free the

[PATCH V3 4/7] blk-flush: use blk_mq_request_bypass_insert()

2017-11-02 Thread Ming Lei
In the following patch, we will use RQF_FLUSH_SEQ to decide: 1) if the flag isn't set, the flush rq need to be inserted via blk_insert_flush() 2) otherwise, the flush rq need to be dispatched directly since it is in flush machinery now. So we use blk_mq_request_bypass_insert() for requests of

[PATCH V3 2/7] blk-flush: don't run queue for requests of bypassing flush

2017-11-02 Thread Ming Lei
blk_insert_flush() should only insert request since run queue always follows it. In case of bypassing flush, we don't need to run queue because every blk_insert_flush() follows one run queue. Signed-off-by: Ming Lei --- block/blk-flush.c | 2 +- 1 file changed, 1

[PATCH V3 5/7] blk-mq-sched: decide how to handle flush rq via RQF_FLUSH_SEQ

2017-11-02 Thread Ming Lei
In case of IO scheduler we always pre-allocate one driver tag before calling blk_insert_flush(), and flush request will be marked as RQF_FLUSH_SEQ once it is in flush machinary. So if RQF_FLUSH_SEQ isn't set, we call blk_insert_flush() to handle the request, otherwise the flush request is

[PATCH V3 6/7] blk-mq: move blk_mq_put_driver_tag*() into blk-mq.h

2017-11-02 Thread Ming Lei
We need this helper to put the driver tag for flush rq, since we will not share tag in the flush request sequence in the following patch in case that I/O scheduler is applied. Signed-off-by: Ming Lei --- block/blk-mq.c | 32 block/blk-mq.h |

[PATCH V3 7/7] blk-mq: don't allocate driver tag beforehand for flush rq

2017-11-02 Thread Ming Lei
The behind idea is simple: 1) for none scheduler, driver tag has to be borrowed for flush rq, otherwise we may run out of tag, and IO hang is caused. And get/put driver tag is actually noop, so reorder tags isn't necessary at all. 2) for real I/O scheduler, we needn't to allocate driver tag

Re: [PATCH] ide: Make ide_cdrom_prep_fs() initialize the sense buffer pointer

2017-11-02 Thread Bart Van Assche
On Thu, 2017-11-02 at 10:36 +0800, Hongxu Jia wrote: > Apply this patch, and the test on my platform is passed. Thank you for having tested this patch. Does this mean that you are OK with adding the following to this patch: Tested-by: Hongxu Jia ? Bart.

Re: [PATCH] ide: Make ide_cdrom_prep_fs() initialize the sense buffer pointer

2017-11-02 Thread Jens Axboe
On 11/01/2017 04:31 PM, Bart Van Assche wrote: > The changes introduced through commit 82ed4db499b8 assume that the > sense buffer pointer in struct scsi_request is initialized for all > requests - passthrough and filesystem requests. Hence make sure > that that pointer is initialized for

Re: [PATCH] skd: use ktime_get_real_seconds()

2017-11-02 Thread Jens Axboe
On 11/02/2017 05:42 AM, Arnd Bergmann wrote: > Like many storage drivers, skd uses an unsigned 32-bit number for > interchanging the current time with the firmware. This will overflow in > y2106 and is otherwise safe. > > However, the get_seconds() function is generally considered deprecated >

答复: [bug report after v4.5-rc1]block: When the scsi device has a timeout IO, the scsi device is stuck when it is deleted

2017-11-02 Thread Zouming (IT)
OK,3ks. -邮件原件- 发件人: chenxiang (M) 发送时间: 2017年11月2日 20:34 收件人: Zouming (IT) ; linux-block@vger.kernel.org; ax...@fb.com 抄送: wangzhoumengjian 主题: Re: [bug report after v4.5-rc1]block: When the scsi device has a timeout IO, the

Re: [bug report after v4.5-rc1]block: When the scsi device has a timeout IO, the scsi device is stuck when it is deleted

2017-11-02 Thread chenxiang (M)
在 2017/11/2 20:16, Zouming (IT) 写道: 1.Repeat steps: (1) send IO on the device /dev/sdx. (2) Simulate an IO lost (3) Use the command before to delete scsi device before IO timeout ehco 1 > /sys/class/sdx/device/delete 2.The stack of delete thead is before: [] msleep+0x2f/0x40 []

[bug report after v4.5-rc1]block: When the scsi device has a timeout IO, the scsi device is stuck when it is deleted

2017-11-02 Thread Zouming (IT)
1.Repeat steps: (1) send IO on the device /dev/sdx. (2) Simulate an IO lost (3) Use the command before to  delete scsi device  before IO timeout       ehco 1 > /sys/class/sdx/device/delete 2.The stack of delete thead is before: [] msleep+0x2f/0x40 [] __blk_drain_queue+0xa4/0x170 []

[PATCH] skd: use ktime_get_real_seconds()

2017-11-02 Thread Arnd Bergmann
Like many storage drivers, skd uses an unsigned 32-bit number for interchanging the current time with the firmware. This will overflow in y2106 and is otherwise safe. However, the get_seconds() function is generally considered deprecated since the behavior is different between 32-bit and 64-bit