Re: [PATCH 0/2] block/SCSI MQ: two RESTART related patches

2017-10-16 Thread Ming Lei
On Tue, Oct 17, 2017 at 01:04:16PM +0800, Ming Lei wrote: > Hi Jens, > > The 1st patch runs idle hctx after dealy in scsi_mq_get_budget(), > so that we can keep same behaviour with before, and it can be > thought as a fix. > > The 2nd patch cleans up RESTART, and removes handling for TAG_SHARED

[PATCH 2/2] blk-mq: don't handle TAG_SHARED in restart

2017-10-16 Thread Ming Lei
Now restart is used in the following cases, and TAG_SHARED is for SCSI only. 1) .get_budget() returns BLK_STS_RESOURCE - if resource in target/host level isn't satistifed, this SCSI device will be added in shost->starved_list, and the whole queue will be rerun (via SCSI's built-in RESTART) in

[PATCH 1/2] SCSI: run idle hctx after delay in scsi_mq_get_budget()

2017-10-16 Thread Ming Lei
If there isn't any outstanding request in this queue, both blk-mq's RESTART and SCSI's builtin RESTART can't work, so we have to deal with this case by running this queue after delay. Fixes: d04b6d97d0a1(scsi: implement .get_budget and .put_budget for blk-mq) Signed-off-by: Ming Lei

[PATCH 0/2] block/SCSI MQ: two RESTART related patches

2017-10-16 Thread Ming Lei
Hi Jens, The 1st patch runs idle hctx after dealy in scsi_mq_get_budget(), so that we can keep same behaviour with before, and it can be thought as a fix. The 2nd patch cleans up RESTART, and removes handling for TAG_SHARED from current blk-mq's RESTART mechanism because SCSI_MQ can covers its

Re: [PATCH v9 09/10] block, scsi: Make SCSI quiesce and resume work reliably

2017-10-16 Thread Martin K. Petersen
Bart, > The contexts from which a SCSI device can be quiesced or resumed are: > * Writing into /sys/class/scsi_device/*/device/state. > * SCSI parallel (SPI) domain validation. > * The SCSI device power management methods. See also scsi_bus_pm_ops. The SCSI bits look fine to me. Acked-by:

Re: [PATCH v9 07/10] ide, scsi: Tell the block layer at request allocation time about preempt requests

2017-10-16 Thread Martin K. Petersen
Bart, > Convert blk_get_request(q, op, __GFP_RECLAIM) into > blk_get_request_flags(q, op, BLK_MQ_PREEMPT). This patch does not > change any functionality. Acked-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering

Re: [RFC] bsg-lib interface cleanup

2017-10-16 Thread Martin K. Petersen
Christoph, > this series cleans up various abuses of the bsg interfaces, and then > splits bsg for SCSI passthrough from bsg for arbitrary transport > passthrough. This removes the scsi_request abuse in bsg-lib that is > very confusing, and also makes sure we can sanity check the requests > we

[bug report] A race between blk_cleanup_queue and blk_timeout_work

2017-10-16 Thread chenxiang (M)
Hi Jens, Christoph, There is a scenario: unplug this disks when running IO in disk, we will find IO is blocked all the times as follows: .. Jobs: 3 (f=3): [M_MM__] [89.7% done] [0K/0K /s] [0 /0 iops] [eta 00m:36s] .. I find there is a race between blk_cleanup_queue and

Re: [PATCH V7 4/6] blk-mq: introduce .get_budget and .put_budget in blk_mq_ops

2017-10-16 Thread Ming Lei
On Mon, Oct 16, 2017 at 01:30:09PM +0200, Hannes Reinecke wrote: > On 10/13/2017 07:29 PM, Ming Lei wrote: > > On Fri, Oct 13, 2017 at 05:08:52PM +, Bart Van Assche wrote: > >> On Sat, 2017-10-14 at 00:45 +0800, Ming Lei wrote: > >>> On Fri, Oct 13, 2017 at 04:31:04PM +, Bart Van Assche

Re: [PATCH v9 09/10] block, scsi: Make SCSI quiesce and resume work reliably

2017-10-16 Thread Ming Lei
On Mon, Oct 16, 2017 at 04:29:04PM -0700, Bart Van Assche wrote: > The contexts from which a SCSI device can be quiesced or resumed are: > * Writing into /sys/class/scsi_device/*/device/state. > * SCSI parallel (SPI) domain validation. > * The SCSI device power management methods. See also

Re: [PATCH v2] blk-mq: Make blk_mq_get_request() error path less confusing

2017-10-16 Thread Ming Lei
On Mon, Oct 16, 2017 at 04:32:26PM -0700, Bart Van Assche wrote: > blk_mq_get_tag() can modify data->ctx. This means that in the > error path of blk_mq_get_request() data->ctx should be passed to > blk_mq_put_ctx() instead of local_ctx. Note: since blk_mq_put_ctx() > ignores its argument, this

Re: [PATCH v2] block/aoe: Convert timers to use timer_setup()

2017-10-16 Thread Kees Cook
On Fri, Oct 6, 2017 at 7:19 AM, Jens Axboe wrote: > On 10/05/2017 05:13 PM, Kees Cook wrote: >> In preparation for unconditionally passing the struct timer_list pointer to >> all timer callbacks, switch to using the new timer_setup() and from_timer() >> to pass the timer pointer

[PATCH v2] blk-mq: Make blk_mq_get_request() error path less confusing

2017-10-16 Thread Bart Van Assche
blk_mq_get_tag() can modify data->ctx. This means that in the error path of blk_mq_get_request() data->ctx should be passed to blk_mq_put_ctx() instead of local_ctx. Note: since blk_mq_put_ctx() ignores its argument, this patch does not change any functionality. References: commit 1ad43c0078b7

[PATCH v9 01/10] md: Rename md_notifier into md_reboot_notifier

2017-10-16 Thread Bart Van Assche
This avoids confusion with the pm notifier that will be added through a later patch. Signed-off-by: Bart Van Assche Reviewed-by: Johannes Thumshirn Reviewed-by: Shaohua Li Tested-by: Martin Steigerwald Cc:

[PATCH v9 08/10] block: Add the QUEUE_FLAG_PREEMPT_ONLY request queue flag

2017-10-16 Thread Bart Van Assche
This flag will be used in the next patch to let the block layer core know whether or not a SCSI request queue has been quiesced. A quiesced SCSI queue namely only processes RQF_PREEMPT requests. Signed-off-by: Bart Van Assche Tested-by: Martin Steigerwald

[PATCH v9 07/10] ide, scsi: Tell the block layer at request allocation time about preempt requests

2017-10-16 Thread Bart Van Assche
Convert blk_get_request(q, op, __GFP_RECLAIM) into blk_get_request_flags(q, op, BLK_MQ_PREEMPT). This patch does not change any functionality. Signed-off-by: Bart Van Assche Tested-by: Martin Steigerwald Acked-by: David S. Miller

[PATCH v9 06/10] block: Introduce BLK_MQ_REQ_PREEMPT

2017-10-16 Thread Bart Van Assche
Set RQF_PREEMPT if BLK_MQ_REQ_PREEMPT is passed to blk_get_request_flags(). Signed-off-by: Bart Van Assche Tested-by: Martin Steigerwald Cc: Christoph Hellwig Cc: Ming Lei Cc: Hannes Reinecke Cc:

[PATCH v9 02/10] md: Introduce md_stop_all_writes()

2017-10-16 Thread Bart Van Assche
Introduce md_stop_all_writes() because the next patch will add a second caller for this function. This patch does not change any functionality. Signed-off-by: Bart Van Assche Reviewed-by: Johannes Thumshirn Reviewed-by: Shaohua Li

[PATCH v9 05/10] block: Introduce blk_get_request_flags()

2017-10-16 Thread Bart Van Assche
A side effect of this patch is that the GFP mask that is passed to several allocation functions in the legacy block layer is changed from GFP_KERNEL into __GFP_DIRECT_RECLAIM. Signed-off-by: Bart Van Assche Tested-by: Martin Steigerwald Cc: Christoph

[PATCH v9 04/10] block: Make q_usage_counter also track legacy requests

2017-10-16 Thread Bart Van Assche
From: Ming Lei This patch makes it possible to pause request allocation for the legacy block layer by calling blk_mq_freeze_queue() and blk_mq_unfreeze_queue(). Signed-off-by: Ming Lei [ bvanassche: Combined two patches into one, edited a comment and

[PATCH v9 10/10] block, nvme: Introduce blk_mq_req_flags_t

2017-10-16 Thread Bart Van Assche
Several block layer and NVMe core functions accept a combination of BLK_MQ_REQ_* flags through the 'flags' argument but there is no verification at compile time whether the right type of block layer flags is passed. Make it possible for sparse to verify this. This patch does not change any

[PATCH v9 03/10] md: Neither resync nor reshape while the system is frozen

2017-10-16 Thread Bart Van Assche
Some people use the md driver on laptops and use the suspend and resume functionality. Since it is essential that submitting of new I/O requests stops before a hibernation image is created, interrupt the md resync and reshape actions if the system is being frozen. Note: the resync and reshape will

[PATCH v9 00/10] block, scsi, md: Improve suspend and resume

2017-10-16 Thread Bart Van Assche
Hello Jens, It is known that during the resume following a hibernate, especially when using an md RAID1 array created on top of SCSI devices, sometimes the system hangs instead of coming up properly. This patch series fixes that problem. These patches have been tested on top of the block layer

[PATCH v9 09/10] block, scsi: Make SCSI quiesce and resume work reliably

2017-10-16 Thread Bart Van Assche
The contexts from which a SCSI device can be quiesced or resumed are: * Writing into /sys/class/scsi_device/*/device/state. * SCSI parallel (SPI) domain validation. * The SCSI device power management methods. See also scsi_bus_pm_ops. It is essential during suspend and resume that neither the

[PATCH v2 3/8] nvmet/fc: Use sgl_alloc() and sgl_free()

2017-10-16 Thread Bart Van Assche
Use the sgl_alloc() and sgl_free() functions instead of open coding these functions. Signed-off-by: Bart Van Assche Reviewed-by: Johannes Thumshirn Cc: Keith Busch Cc: Christoph Hellwig Cc: James Smart

[PATCH v2 7/8] scsi/pmcraid: Remove an unused structure member

2017-10-16 Thread Bart Van Assche
Signed-off-by: Bart Van Assche Reviewed-by: Johannes Thumshirn Cc: linux-s...@vger.kernel.org Cc: Martin K. Petersen Cc: Anil Ravindranath --- drivers/scsi/pmcraid.h | 1 - 1 file

[PATCH v2 1/8] lib/scatterlist: Introduce sgl_alloc() and sgl_free()

2017-10-16 Thread Bart Van Assche
Many kernel drivers contain code that allocates and frees both a scatterlist and the pages that populate that scatterlist. Introduce functions in lib/scatterlist.c that perform these tasks instead of duplicating this functionality in multiple drivers. Only include these functions in the build if

[PATCH v2 8/8] scsi/pmcraid: Use sgl_alloc_order() and sgl_free_order()

2017-10-16 Thread Bart Van Assche
Use the sgl_alloc_order() and sgl_free_order() functions instead of open coding these functions. Signed-off-by: Bart Van Assche Reviewed-by: Johannes Thumshirn Cc: linux-s...@vger.kernel.org Cc: Martin K. Petersen Cc: Anil

[PATCH v2 2/8] crypto: scompress - use sgl_alloc() and sgl_free()

2017-10-16 Thread Bart Van Assche
Use the sgl_alloc() and sgl_free() functions instead of open coding these functions. Signed-off-by: Bart Van Assche Cc: Ard Biesheuvel Cc: Herbert Xu --- crypto/Kconfig | 1 + crypto/scompress.c | 51

[PATCH v2 4/8] nvmet/rdma: Use sgl_alloc() and sgl_free()

2017-10-16 Thread Bart Van Assche
Use the sgl_alloc() and sgl_free() functions instead of open coding these functions. Signed-off-by: Bart Van Assche Reviewed-by: Johannes Thumshirn Cc: Keith Busch Cc: Christoph Hellwig Cc: Sagi Grimberg

[PATCH v2 6/8] scsi/ipr: Use sgl_alloc_order() and sgl_free_order()

2017-10-16 Thread Bart Van Assche
Use the sgl_alloc_order() and sgl_free_order() functions instead of open coding these functions. Signed-off-by: Bart Van Assche Reviewed-by: Johannes Thumshirn Cc: linux-s...@vger.kernel.org Cc: Martin K. Petersen Cc:

[PATCH v2 0/8] Introduce sgl_alloc() and sgl_free()

2017-10-16 Thread Bart Van Assche
Hello Jens, As you know there are multiple drivers that both allocate a scatter/gather list and populate that list with pages. This patch series moves the code for allocating and freeing such scatterlists from these drivers into lib/scatterlist.c. Please consider this patch series for kernel

[PATCH v2 5/8] target: Use sgl_alloc_order() and sgl_free()

2017-10-16 Thread Bart Van Assche
Use the sgl_alloc_order() and sgl_free() functions instead of open coding these functions. Signed-off-by: Bart Van Assche Cc: Nicholas A. Bellinger Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Sagi Grimberg

Re: [PATCH] bcache: writeback rate clamping: make 32 bit safe

2017-10-16 Thread Jens Axboe
On 10/16/2017 01:07 PM, Michael Lyle wrote: > Jens-- > > Thanks for your patience. > > On Mon, Oct 16, 2017 at 12:01 PM, Jens Axboe wrote: >> On 10/16/2017 11:34 AM, Michael Lyle wrote: >>> Sorry this got through to linux-block, was detected by the kbuilds test >>> robot.

Re: [PATCH] bcache: writeback rate clamping: make 32 bit safe

2017-10-16 Thread Michael Lyle
Jens-- Thanks for your patience. On Mon, Oct 16, 2017 at 12:01 PM, Jens Axboe wrote: > On 10/16/2017 11:34 AM, Michael Lyle wrote: >> Sorry this got through to linux-block, was detected by the kbuilds test >> robot. NSEC_PER_SEC is a long constant; 2.5 * 10^9 doesn't fit in a

Re: [PATCH] bcache: writeback rate clamping: make 32 bit safe

2017-10-16 Thread Jens Axboe
On 10/16/2017 11:34 AM, Michael Lyle wrote: > Sorry this got through to linux-block, was detected by the kbuilds test > robot. NSEC_PER_SEC is a long constant; 2.5 * 10^9 doesn't fit in a > signed long constant. Applied, but you should remember to add Fixes lines when a patch explicitly fixes a

Re: [PATCH] block: fix Sphinx kernel-doc warning

2017-10-16 Thread Jens Axboe
On 10/16/2017 12:01 PM, Randy Dunlap wrote: > From: Randy Dunlap > > Sphinx treats symbols that end with '_' as a kind of special > documentation indicator, so fix that by adding an ending '*' > to it. Added for 4.15, thanks Randy. -- Jens Axboe

Re: [PATCHv3] bcache: only permit to recovery read error when cache device is clean

2017-10-16 Thread Coly Li
On 2017/10/17 上午1:39, Michael Lyle wrote: > Hey Coly-- > > On Thu, Sep 21, 2017 at 12:54 PM, Coly Li wrote: >> When bcache does read I/Os, for example in writeback or writethrough mode, >> if a read request on cache device is failed, bcache will try to recovery >> the request by

[PATCHv4] bcache: only permit to recovery read error when cache device is clean

2017-10-16 Thread Coly Li
When bcache does read I/Os, for example in writeback or writethrough mode, if a read request on cache device is failed, bcache will try to recovery the request by reading from cached device. If the data on cached device is not synced with cache device, then requester will get a stale data. For

[PATCH] block: fix Sphinx kernel-doc warning

2017-10-16 Thread Randy Dunlap
From: Randy Dunlap Sphinx treats symbols that end with '_' as a kind of special documentation indicator, so fix that by adding an ending '*' to it. ../block/bio.c:404: ERROR: Unknown target name: "gfp". Signed-off-by: Randy Dunlap --- block/bio.c

Re: [PATCH] bcache: writeback rate clamping: make 32 bit safe

2017-10-16 Thread Coly Li
On 2017/10/17 上午1:34, Michael Lyle wrote: > Sorry this got through to linux-block, was detected by the kbuilds test > robot. NSEC_PER_SEC is a long constant; 2.5 * 10^9 doesn't fit in a > signed long constant. > > Signed-off-by: Michael Lyle I forgot i386 config... sorry too...

Re: [PATCHv3] bcache: only permit to recovery read error when cache device is clean

2017-10-16 Thread Michael Lyle
Hey Coly-- On Thu, Sep 21, 2017 at 12:54 PM, Coly Li wrote: > When bcache does read I/Os, for example in writeback or writethrough mode, > if a read request on cache device is failed, bcache will try to recovery > the request by reading from cached device. If the data on cached

[PATCH] bcache: writeback rate clamping: make 32 bit safe

2017-10-16 Thread Michael Lyle
Sorry this got through to linux-block, was detected by the kbuilds test robot. NSEC_PER_SEC is a long constant; 2.5 * 10^9 doesn't fit in a signed long constant. Signed-off-by: Michael Lyle --- drivers/md/bcache/util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

Re: [PATCH 8/9] block: pass full fmode_t to blk_verify_command

2017-10-16 Thread Benjamin Block
On Tue, Oct 03, 2017 at 12:48:44PM +0200, Christoph Hellwig wrote: > Use the obvious calling convention. > > Signed-off-by: Christoph Hellwig > --- > block/bsg.c| 18 -- > block/scsi_ioctl.c | 8 > drivers/scsi/sg.c | 2 +- >

Re: [PATCH 6/9] bsg-lib: introduce a timeout field in struct bsg_job

2017-10-16 Thread Benjamin Block
On Tue, Oct 03, 2017 at 12:48:42PM +0200, Christoph Hellwig wrote: > The zfcp driver wants to know the timeout for a bsg job, so add a field > to struct bsg_job for it in preparation of not exposing the request > to the bsg-lib users. > > Signed-off-by: Christoph Hellwig > --- >

Re: [PATCH V7 4/6] blk-mq: introduce .get_budget and .put_budget in blk_mq_ops

2017-10-16 Thread Bart Van Assche
On Mon, 2017-10-16 at 13:30 +0200, Hannes Reinecke wrote: > On Fri, Oct 13, 2017 at 05:08:52PM +, Bart Van Assche wrote: > > (+Himanshu Madhani) > > > > Himanshu, do you perhaps know whether it is safe to increase cmd_per_lun for > > the qla2xxx initiator driver to the scsi_host->can_queue

Re: [GIT PULL 02/58] lightnvm: prevent bd removal if busy

2017-10-16 Thread Matias Bjørling
On Fri, Oct 13, 2017 at 5:35 PM, Rakesh Pandit wrote: > On Fri, Oct 13, 2017 at 07:58:09AM -0700, Christoph Hellwig wrote: >> On Fri, Oct 13, 2017 at 02:45:51PM +0200, Matias Bjørling wrote: >> > From: Rakesh Pandit >> > >> > When a virtual block device is

Re: [PATCH 00/15] bcache: series of patches for 4.15

2017-10-16 Thread Jens Axboe
On Fri, Oct 13 2017, Michael Lyle wrote: > Jens, and everyone: > > Here is the current series of work for inclusion in next and for 4.15's > merge window. We may get some additional fixes, but this is most of the > work we expect. All have been previously sent to these lists except the > very

Re: [PATCH v2 0/3] Move tagset reinit to its only current consumer, nvme-core

2017-10-16 Thread Jens Axboe
On 10/16/2017 06:48 AM, Christoph Hellwig wrote: > Jens, are you fine with picking this up throught the nvme tree? > I think Sagi's later changes rely on it, so that would make life > a littler easier. Yeah that's fine, you can add my reviewed-by to the patches as well. -- Jens Axboe

Re: [PATCH v2 2/2] block: cope with WRITE ZEROES failing in blkdev_issue_zeroout()

2017-10-16 Thread Ilya Dryomov
On Mon, Oct 16, 2017 at 1:44 PM, Christoph Hellwig wrote: > On Fri, Oct 06, 2017 at 02:31:20PM +0200, Ilya Dryomov wrote: >> This would unconditionally overwrite any WRITE ZEROS error. If we get >> e.g. -EIO, and manual zeroing is not allowed, I don't think we want to >>

[PATCH v3 2/2] block: cope with WRITE ZEROES failing in blkdev_issue_zeroout()

2017-10-16 Thread Ilya Dryomov
sd_config_write_same() ignores ->max_ws_blocks == 0 and resets it to permit trying WRITE SAME on older SCSI devices, unless ->no_write_same is set. Because REQ_OP_WRITE_ZEROES is implemented in terms of WRITE SAME, blkdev_issue_zeroout() may fail with -EREMOTEIO: $ fallocate -zn -l 1k /dev/sdg

[PATCH v3 1/2] block: factor out __blkdev_issue_zero_pages()

2017-10-16 Thread Ilya Dryomov
blkdev_issue_zeroout() will use this in !BLKDEV_ZERO_NOFALLBACK case. Signed-off-by: Ilya Dryomov --- block/blk-lib.c | 63 + 1 file changed, 37 insertions(+), 26 deletions(-) diff --git a/block/blk-lib.c

[PATCH v3 0/2] block: cope with WRITE ZEROES failing in blkdev_issue_zeroout()

2017-10-16 Thread Ilya Dryomov
Hi Christoph, Martin, blkdev_issue_zeroout() now checks for any error. This required a minor refactor, so I dropped the stable tag, Jens can add it back if needed. v2 -> v3: - another code flow change in blkdev_issue_zeroout() suggested by Christoph -- no functional changes v1 -> v2: -

Re: [PATCH v2 0/3] Move tagset reinit to its only current consumer, nvme-core

2017-10-16 Thread Christoph Hellwig
Jens, are you fine with picking this up throught the nvme tree? I think Sagi's later changes rely on it, so that would make life a littler easier.

Re: [PATCH v2 2/2] block: cope with WRITE ZEROES failing in blkdev_issue_zeroout()

2017-10-16 Thread Christoph Hellwig
On Fri, Oct 06, 2017 at 02:31:20PM +0200, Ilya Dryomov wrote: > This would unconditionally overwrite any WRITE ZEROS error. If we get > e.g. -EIO, and manual zeroing is not allowed, I don't think we want to > return -EOPNOTSUPP? > > Returning -EOPNOTSUPP to mean "can't zero using either method"

Re: [PATCH V7 4/6] blk-mq: introduce .get_budget and .put_budget in blk_mq_ops

2017-10-16 Thread Hannes Reinecke
On 10/13/2017 07:29 PM, Ming Lei wrote: > On Fri, Oct 13, 2017 at 05:08:52PM +, Bart Van Assche wrote: >> On Sat, 2017-10-14 at 00:45 +0800, Ming Lei wrote: >>> On Fri, Oct 13, 2017 at 04:31:04PM +, Bart Van Assche wrote: On Sat, 2017-10-14 at 00:07 +0800, Ming Lei wrote: >

Re: [PATCH v2 2/2] block: cope with WRITE ZEROES failing in blkdev_issue_zeroout()

2017-10-16 Thread Ilya Dryomov
On Fri, Oct 6, 2017 at 2:31 PM, Ilya Dryomov wrote: > On Fri, Oct 6, 2017 at 2:05 PM, Christoph Hellwig wrote: >> On Thu, Oct 05, 2017 at 09:32:33PM +0200, Ilya Dryomov wrote: >>> This is to avoid returning -EREMOTEIO in the following case: device >>>