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 +0000, 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

Re: [PATCH] linux/types.h: Restore the ability to disable sparse endianness checks

2017-10-16 Thread Bart Van Assche
On Mon, 2017-10-16 at 18:27 +0300, Michael S. Tsirkin wrote: > On Mon, Oct 16, 2017 at 01:57:35PM +0000, Bart Van Assche wrote: > > On Mon, 2017-10-16 at 16:34 +0300, Michael S. Tsirkin wrote: > > > I don't see how it'll help make things better. OTOH if the specific > &

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

2017-10-13 Thread Bart Van Assche
On Sat, 2017-10-14 at 02:05 +0800, Ming Lei wrote: > @@ -89,19 +89,36 @@ static bool blk_mq_sched_restart_hctx(struct > blk_mq_hw_ctx *hctx) > return false; > } > > -static void blk_mq_do_dispatch_sched(struct blk_mq_hw_ctx *hctx) > +static bool blk_mq_do_dispatch_sched(struct

Re: [PATCH V9 6/7] SCSI: allow to pass null rq to scsi_prep_state_check()

2017-10-13 Thread Bart Van Assche
On Sat, 2017-10-14 at 02:05 +0800, Ming Lei wrote: > In the following patch, we will implement scsi_get_budget() > which need to call scsi_prep_state_check() when rq isn't > dequeued yet. My understanding is that this change is only needed because scsi_mq_get_budget() calls

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

2017-10-13 Thread Bart Van Assche
On Fri, 2017-10-13 at 10:43 -0700, Randy Dunlap wrote: > On 10/12/17 15:45, Bart Van Assche wrote: > > + * @sg: Scatterlist with one or more elements > > @sgl: Thanks Randy. I will fix this before I repost this series. Bart.

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

2017-10-13 Thread Bart Van Assche
On Sat, 2017-10-14 at 01:29 +0800, Ming Lei wrote: > ->can_queue is size of the whole tag space shared by all LUNs, looks it isn't > reasonable to increase cmd_per_lun to .can_queue. Sorry but I disagree. Setting cmd_per_lun to a value lower than can_queue will result in suboptimal performance if

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

2017-10-13 Thread Bart Van Assche
On Sat, 2017-10-14 at 00:45 +0800, Ming Lei wrote: > On Fri, Oct 13, 2017 at 04:31:04PM +0000, Bart Van Assche wrote: > > On Sat, 2017-10-14 at 00:07 +0800, Ming Lei wrote: > > > Actually it is in hot path, for example, lpfc and qla2xx's queue depth is > > > 3, > &g

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

2017-10-13 Thread Bart Van Assche
On Sat, 2017-10-14 at 00:07 +0800, Ming Lei wrote: > Actually it is in hot path, for example, lpfc and qla2xx's queue depth is 3, Sorry but I doubt whether that is correct. More in general, I don't know any modern storage HBA for which the default queue depth is so low. Bart.

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

2017-10-12 Thread Bart Van Assche
On Thu, 2017-10-12 at 16:52 -0600, Jens Axboe wrote: > On 10/12/2017 04:45 PM, Bart Van Assche wrote: > > +++ b/include/linux/sgl_alloc.h > > @@ -0,0 +1,16 @@ > > +#ifndef _SGL_ALLOC_H_ > > +#define _SGL_ALLOC_H_ > > + > > +#include /* bool,

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

2017-10-12 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 <bart.vanass...@wdc.com> Cc: linux-scsi@vger.kernel.org Cc: Martin K. Petersen <martin.peter...@oracle.com> Cc: Anil Ravindranath <anil_ravindran...

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

2017-10-12 Thread Bart Van Assche
since for these drivers sgl allocation occurs in the hot path. Thanks, Bart. Bart Van Assche (8): lib: Introduce sgl_alloc() and sgl_free() crypto: scompress - use sgl_alloc() and sgl_free() nvmet/fc: Use sgl_alloc() and sgl_free() nvmet/rdma: Use sgl_alloc() and sgl_free() target: Use

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

2017-10-12 Thread Bart Van Assche
Use the sgl_alloc() and sgl_free() functions instead of open coding these functions. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Keith Busch <keith.bu...@intel.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Sagi Grimberg <s...@grimberg.me> --- drivers/

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

2017-10-12 Thread Bart Van Assche
Use the sgl_alloc() and sgl_free() functions instead of open coding these functions. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Ard Biesheuvel <ard.biesheu...@linaro.org> Cc: Herbert Xu <herb...@gondor.apana.org.au> --- crypto/Kconfig | 1 + crypt

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

2017-10-12 Thread Bart Van Assche
Many kernel drivers contain code that allocate and free both a scatterlist and the pages that populate that scatterlist. Introduce functions under lib/ that perform these tasks instead of duplicating this functionality in multiple drivers. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.

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

2017-10-12 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 <bart.vanass...@wdc.com> Cc: Nicholas A. Bellinger <n...@linux-iscsi.org> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.com&

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

2017-10-12 Thread Bart Van Assche
Use the sgl_alloc() and sgl_free() functions instead of open coding these functions. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Keith Busch <keith.bu...@intel.com> Cc: Christoph Hellwig <h...@lst.de> Cc: James Smart <james.sm...@broadcom.com> Cc: Joh

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

2017-10-12 Thread Bart Van Assche
Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: linux-scsi@vger.kernel.org Cc: Martin K. Petersen <martin.peter...@oracle.com> Cc: Anil Ravindranath <anil_ravindran...@pmc-sierra.com> --- drivers/scsi/pmcraid.h | 1 - 1 file changed, 1 deletion(-) diff --git a/driv

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

2017-10-12 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 <bart.vanass...@wdc.com> Cc: linux-scsi@vger.kernel.org Cc: Martin K. Petersen <martin.peter...@oracle.com> Cc: Brian King <brk...@linux.vnet.ibm.com>

Re: [PATCH V7 5/6] blk-mq-sched: improve dispatching from sw queue

2017-10-12 Thread Bart Van Assche
On 10/12/17 11:37, Ming Lei wrote: [ ... ] This patch improves dispatching from sw queue by using the callback of .get_budget and .put_budget Reviewed-by: Omar Sandoval <osan...@fb.com> Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com> Signed-off-by: Ming Lei <ming

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

2017-10-12 Thread Bart Van Assche
On Fri, 2017-10-13 at 00:02 +0800, Ming Lei wrote: > On Tue, Oct 10, 2017 at 02:03:45PM -0700, Bart Van Assche wrote: > > [ ... ] > > + /* If the SCSI device has already been quiesced, do nothing. */ > > + if (blk_set_preempt_only(q)) > > + return 0; >

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

2017-10-12 Thread Bart Van Assche
On Wed, 2017-10-11 at 12:32 -0700, Shaohua Li wrote: > On Wed, Oct 11, 2017 at 05:17:56PM +0000, Bart Van Assche wrote: > > On Tue, 2017-10-10 at 18:48 -0700, Shaohua Li wrote: > > > The problem is __md_stop_writes set some bit like MD_RECOVERY_FROZEN, > > &g

Re: [PATCH V6 4/5] blk-mq-sched: improve dispatching from sw queue

2017-10-12 Thread Bart Van Assche
On Thu, 2017-10-12 at 18:01 +0800, Ming Lei wrote: > Even EWMA approach isn't good on SCSI-MQ too, because > some SCSI's .cmd_per_lun is very small, such as 3 on > lpfc and qla2xxx, and one full flush will trigger > BLK_STS_RESOURCE easily. > > So I suggest to use the way of q->queue_depth first,

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

2017-10-11 Thread Bart Van Assche
On Tue, 2017-10-10 at 18:48 -0700, Shaohua Li wrote: > The problem is __md_stop_writes set some bit like MD_RECOVERY_FROZEN, which > will prevent md_check_recovery restarting resync/reshape. I think we need > preserve mddev->recovery in suspend prepare and restore after resume Hello Shaohua, As

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

2017-10-10 Thread Bart Van Assche
On Tue, 2017-10-10 at 15:30 -0700, Shaohua Li wrote: > On Tue, Oct 10, 2017 at 02:03:39PM -0700, Bart Van Assche wrote: > > 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

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

2017-10-10 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 <bart.vanass...@wdc.com> Cc: Martin K. Petersen <martin.peter...@oracle.com> Acked-by: David S. Miller <da..

[PATCH v8 06/10] block: Introduce BLK_MQ_REQ_PREEMPT

2017-10-10 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 <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Ming Lei <ming@redhat.com> Cc: Hannes Reinecke <h...@suse.com> Cc: Johannes Thumshirn <jthumsh

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

2017-10-10 Thread Bart Van Assche
ed a comment and made sure REQ_NOWAIT is handled properly in blk_old_get_request() ] Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> Cc: Ming Lei <ming@redhat.com>

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

2017-10-10 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 <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Mi

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

2017-10-10 Thread Bart Van Assche
and v3: - Made md kernel threads freezable. - Changed the approach for quiescing SCSI devices again. - Addressed Ming's review comments. Changes compared to v1 of this patch series: - Changed the approach and rewrote the patch series. Bart Van Assche (9): md: Rename md_notifier

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

2017-10-10 Thread Bart Van Assche
functionality. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: linux-n...@lists.infradead.org Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.com> Cc: Johannes Thumshirn <jthumsh...@suse.de> Cc: Ming Lei <ming@redhat.com> ---

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

2017-10-10 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 <bart.vanass...@wdc.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> Cc: Shaohua Li <s...@kernel.o

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

2017-10-10 Thread Bart Van Assche
will restart after the system is resumed and a message similar to the following will appear in the system log: md: md0: data-check interrupted. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Shaohua Li <s...@kernel.org> Cc: linux-r...@vger.kernel.org Cc: Ming Lei <ming

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

2017-10-10 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 <bart.vanass...@wdc.com> Cc: Ming Lei <ming@redha

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

2017-10-10 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 <bart.vanass...@wdc.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> Cc: Shaohua Li <s...@kernel.org> Cc: linux-r...@vger.kernel.org Cc: Ming Lei <mi

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

2017-10-10 Thread Bart Van Assche
s=512 --rw=randread \ --ioengine=libaio --numjobs=4 --iodepth=16 --iodepth_batch=1 --thread \ --loops=$((2**31)) & pid=$! sleep 1 systemctl hibernate sleep 10 kill $pid Reported-by: Oleksandr Natalenko <oleksa...@natalenko.name> References: "I/O hangs after resuming from suspend-to-ram&quo

Re: [PATCH v7 9/9] block, scsi: Make SCSI quiesce and resume work reliably

2017-10-10 Thread Bart Van Assche
On Tue, 2017-10-10 at 18:56 +0800, Ming Lei wrote: > On Mon, Oct 09, 2017 at 04:14:00PM -0700, Bart Van Assche wrote: > > [ ... ] > > int > > scsi_device_quiesce(struct scsi_device *sdev) > > { > > + struct request_queue *q = sdev->request_queue; > >

Re: [PATCH] scsi: use set_host_byte instead of open-coding it

2017-10-10 Thread Bart Van Assche
On Tue, 2017-10-10 at 17:29 +0200, Johannes Thumshirn wrote: > Call set_host_byte() instead of open-coding it. > > Converted using this simple Coccinelle spatch > > > @@ > local idexpression struct scsi_cmnd *c; > expression E1; > @@ > > - c->result = E1 << 16; > + set_host_byte(c, E1); >

Re: [PATCH v7 9/9] block, scsi: Make SCSI quiesce and resume work reliably

2017-10-10 Thread Bart Van Assche
On Tue, 2017-10-10 at 09:57 +0200, Martin Steigerwald wrote: > Bart Van Assche - 09.10.17, 16:14: > > The contexts from which a SCSI device can be quiesced or resumed are: > > [ ... ] > > Does this as reliably fix the issue as the patches from Ming? I mean in *rea

Re: [PATCH v7 0/9] Hello Jens,

2017-10-09 Thread Bart Van Assche
On Mon, 2017-10-09 at 16:13 -0700, Bart Van Assche wrote: > [ ... ] Just like for v6, the title of this series should have been: "block, scsi, md: Improve suspend and resume"

[PATCH v7 4/9] block: Make q_usage_counter also track legacy requests

2017-10-09 Thread Bart Van Assche
ed a comment and made sure REQ_NOWAIT is handled properly in blk_old_get_request() ] Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Cc: Ming Lei <ming@redhat.com> Cc: Hannes Reinecke <h...@suse.com> Cc: Johannes Thumshirn

[PATCH v7 2/9] md: Introduce md_stop_all_writes()

2017-10-09 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 <bart.vanass...@wdc.com> Cc: Shaohua Li <s...@kernel.org> Cc: linux-r...@vger.kernel.org Cc: Ming Lei <ming

[PATCH v7 5/9] block: Introduce blk_get_request_flags()

2017-10-09 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 <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Mi

[PATCH v7 9/9] block, scsi: Make SCSI quiesce and resume work reliably

2017-10-09 Thread Bart Van Assche
s=512 --rw=randread \ --ioengine=libaio --numjobs=4 --iodepth=16 --iodepth_batch=1 --thread \ --loops=$((2**31)) & pid=$! sleep 1 systemctl hibernate sleep 10 kill $pid Reported-by: Oleksandr Natalenko <oleksa...@natalenko.name> References: "I/O hangs after resuming from suspend-to-ram&quo

[PATCH v7 1/9] md: Rename md_notifier into md_reboot_notifier

2017-10-09 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 <bart.vanass...@wdc.com> Cc: Shaohua Li <s...@kernel.org> Cc: linux-r...@vger.kernel.org Cc: Ming Lei <ming@redhat.com> Cc: Christoph Hellwig <h...@lst.de

[PATCH v7 7/9] ide, scsi: Tell the block layer at request allocation time about preempt requests

2017-10-09 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 <bart.vanass...@wdc.com> Cc: Martin K. Petersen <martin.peter...@oracle.com> Acked-by: David S. Miller <da..

[PATCH v7 3/9] md: Neither resync nor reshape while the system is frozen

2017-10-09 Thread Bart Van Assche
will restart after the system is resumed and a message similar to the following will appear in the system log: md: md0: data-check interrupted. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Shaohua Li <s...@kernel.org> Cc: linux-r...@vger.kernel.org Cc: Ming Lei <ming

[PATCH v7 0/9] Hello Jens,

2017-10-09 Thread Bart Van Assche
el threads freezable. - Changed the approach for quiescing SCSI devices again. - Addressed Ming's review comments. Changes compared to v1 of this patch series: - Changed the approach and rewrote the patch series. Bart Van Assche (8): md: Rename md_notifier into md_reboot_notifier md:

[PATCH v7 6/9] block: Introduce BLK_MQ_REQ_PREEMPT

2017-10-09 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 <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Ming Lei <ming@redhat.com> Cc: Hannes Reinecke <h...@suse.com> Cc: Johannes Thumshirn <jthumsh

[PATCH v7 8/9] block: Add the QUEUE_FLAG_PREEMPT_ONLY request queue flag

2017-10-09 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 <bart.vanass...@wdc.com> Cc: Ming Lei <ming@redha

Re: [PATCH V6 13/14] block: mq-deadline: Limit write request dispatch for zoned block devices

2017-10-03 Thread Bart Van Assche
On Tue, 2017-10-03 at 09:19 +0900, Damien Le Moal wrote: > On 10/3/17 08:44, Bart Van Assche wrote: > > On Mon, 2017-10-02 at 16:15 +0900, Damien Le Moal wrote: > > > static void deadline_wunlock_zone(struct deadline_data *dd, > > >

Re: [PATCH V8 5/8] percpu-refcount: introduce __percpu_ref_tryget_live

2017-10-03 Thread Bart Van Assche
On Tue, 2017-10-03 at 22:04 +0800, Ming Lei wrote: > Block layer need to call this function after holding > rcu lock in a real hot path, so introduce this helper. Since it is allowed to nest rcu_read_lock_sched() calls I don't think that this patch is necessary. Bart.

Re: [PATCH v2 3/4] scsi: ufs: Remove unused #defines

2017-10-03 Thread Bart Van Assche
On Tue, 2017-10-03 at 20:51 +0530, Alim Akhtar wrote: > HOST_ERROR_INDICATOR and DEVICE_ERROR_INDICATOR are not used > anywhere. Also as per JESD223C specification, bit[7:4] are reserved. > Lets remove these #defines. Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH v2 v2 2/4] scsi: ufs-qcom: Remove uses of UFS_BIT() macro

2017-10-03 Thread Bart Van Assche
On Tue, 2017-10-03 at 20:51 +0530, Alim Akhtar wrote: > Use actual bit position instead of UFS_BIT() macro. This > patch also changes bit-17 to meaningful #define. Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH v2 4/4] scsi: ufs: Remove unused UFS_BIT() macro

2017-10-03 Thread Bart Van Assche
On Tue, 2017-10-03 at 20:51 +0530, Alim Akhtar wrote: > Since we have converted all the user of UFS_BIT() macro > with the actual bit position, let remove unused UFS_BIT()macro. Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH v2 1/4] scsi: ufs: Change HCI macro to actual bit position

2017-10-03 Thread Bart Van Assche
ite these macro definition with the actual bit position. Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH V6 13/14] block: mq-deadline: Limit write request dispatch for zoned block devices

2017-10-02 Thread Bart Van Assche
On Mon, 2017-10-02 at 16:15 +0900, Damien Le Moal wrote: > When dispatching write requests to a zoned block device, only allow > requests targeting an unlocked zone. Requests targeting a locked zone > are left in the scheduler queue to preserve the initial write order. > If no write request can be

Re: [PATCH V6 12/14] block: mq-deadline: Introduce zone locking support

2017-10-02 Thread Bart Van Assche
e request is requeued (inserted). Anyway: Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH V6 10/14] block: mq-deadline: Add zoned block device data

2017-10-02 Thread Bart Van Assche
. per-zone write locking ..."? Anyway: Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH V5 02/14] scsi: sd_zbc: Fix comments and indentation

2017-10-02 Thread Bart Van Assche
On Mon, 2017-09-25 at 15:14 +0900, Damien Le Moal wrote: > + * sd_zbc_zone_no - Get the number of the zone conataining a sector. Please fix the spelling in the above comment ("conataining"). Anyway: Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH V6 08/14] scsi: sd_zbc: Limit zone write locking to sequential zones

2017-10-02 Thread Bart Van Assche
On Mon, 2017-10-02 at 16:15 +0900, Damien Le Moal wrote: > + * There is no write constraints on conventional zones. So any write ^^ are? Anyway: Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH V6 07/14] scsi: sd_zbc: Initialize device request queue zoned data

2017-10-02 Thread Bart Van Assche
; the helper sd_zbc_alloc_zone_bitmap(). Using this helper, wait for the > disk capacity and number of zones to stabilize on the second > revalidation pass to allocate and initialize the bitmaps. Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH V6 02/14] scsi: sd_zbc: Fix comments and indentation

2017-10-02 Thread Bart Van Assche
On Mon, 2017-10-02 at 16:15 +0900, Damien Le Moal wrote: > Fix comments style (use kernel-doc style) and content to clarify some > functions. Also fix some functions signature indentation and remove a > useless blank line in sd_zbc_read_zones(). Reviewed-by: Bart Van Assche <

Re: [PATCH 1/3] scsi: ufs: Change HCI marco to actual bit position

2017-10-02 Thread Bart Van Assche
On Sat, 2017-09-30 at 11:52 +0530, Alim Akhtar wrote: > Currently UFS HCI uses UFS_BIT() macro to get various bit > position for the hardware registers status bits. Which makes > code longer instead of shorter. This macro does not improve > code readability as well. > Lets re-write these macro

Re: [PATCHv6 2/5] scsi: Export blacklist flags to sysfs

2017-10-02 Thread Bart Van Assche
we're exporting an additional attribute 'blacklist' > containing the blacklist flags for this device. Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH V7 5/6] block: support PREEMPT_ONLY

2017-10-02 Thread Bart Van Assche
On Sat, 2017-09-30 at 14:12 +0800, Ming Lei wrote: > +void blk_set_preempt_only(struct request_queue *q, bool preempt_only) > +{ > + blk_mq_freeze_queue(q); > + if (preempt_only) > + queue_flag_set_unlocked(QUEUE_FLAG_PREEMPT_ONLY, q); > + else > +

Re: [PATCH V7 2/6] block: tracking request allocation with q_usage_counter

2017-10-02 Thread Bart Van Assche
On Sat, 2017-09-30 at 14:12 +0800, Ming Lei wrote: > @@ -1395,16 +1401,21 @@ static struct request *blk_old_get_request(struct > request_queue *q, > unsigned int op, gfp_t gfp_mask) > { > struct request *rq; > + int ret = 0; > >

Re: [PATCH V6 6/6] SCSI: set block queue at preempt only when SCSI device is put into quiesce

2017-09-27 Thread Bart Van Assche
On Wed, 2017-09-27 at 13:48 +0800, Ming Lei wrote: > @@ -2928,12 +2929,28 @@ scsi_device_quiesce(struct scsi_device *sdev) > { > int err; > > + /* > + * Simply quiesing SCSI device isn't safe, it is easy > + * to use up requests because all these allocated requests > +

Re: [PATCH] scsi: ioctl reset should wait for IOs to complete

2017-09-26 Thread Bart Van Assche
On Tue, 2017-09-26 at 10:22 -0700, Lee Duncan wrote: > The SCSI ioctl reset path is smart enough to set the > flag tmf_in_progress when a user-requested reset is > processed, but it does not wait for IO that is in > flight. This can result in lost IOs and hung > processes. We should wait for a

Re: [PATCHv5 2/5] scsi: Export blacklist flags to sysfs

2017-09-26 Thread Bart Van Assche
On Fri, 2017-09-22 at 08:04 +0200, Hannes Reinecke wrote: > +static ssize_t > +sdev_show_blacklist(struct device *dev, struct device_attribute *attr, > + char *buf) > +{ Please make this function accept the output buffer size as fourth argument. > + if (len) > +

Re: [PATCH] scsi: fc: check for rport presence in fc_block_scsi_eh

2017-09-25 Thread Bart Van Assche
> struct fc_rport *rport = starget_to_rport(scsi_target(cmnd->device)); > > + if (WARN_ON(!rport)) > + return 0; > + > return fc_block_rport(rport); > } > EXPORT_SYMBOL(fc_block_scsi_eh); Did you perhaps intend to use WARN_ON_ONCE() instead of WARN_ON()? Anyway: Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH V5 13/14] block: mq-deadline: Limit write request dispatch for zoned block devices

2017-09-25 Thread Bart Van Assche
On Mon, 2017-09-25 at 15:14 +0900, Damien Le Moal wrote: > - return rq_entry_fifo(dd->fifo_list[data_dir].next); > + if (!dd->zones_wlock || data_dir == READ) > + return rq_entry_fifo(dd->fifo_list[data_dir].next); > + > + spin_lock_irqsave(>zone_lock, flags); > + > +

Re: [PATCH V5 12/14] block: mq-deadline: Introduce zone locking support

2017-09-25 Thread Bart Van Assche
On Mon, 2017-09-25 at 15:14 +0900, Damien Le Moal wrote: > +static inline bool deadline_request_needs_zone_wlock(struct deadline_data > *dd, > + struct request *rq) > +{ > + > + if (!dd->zones_wlock) > + return false; > + > + if

Re: [PATCH V5 11/14] blokc: mq-deadline: Introduce dispatch helpers

2017-09-25 Thread Bart Van Assche
). Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH V5 10/14] block: mq-deadline: Add zoned block device data

2017-09-25 Thread Bart Van Assche
On Mon, 2017-09-25 at 15:14 +0900, Damien Le Moal wrote: > Modify mq-dealine init_queue and exit_queue elevator methods to handle ^^ mq-deadline ? > +static int deadline_init_zones_wlock(struct request_queue *q, > + struct deadline_data

Re: [PATCH V5 07/14] scsi: sd_zbc: Initialize device request queue zoned data

2017-09-25 Thread Bart Van Assche
On Mon, 2017-09-25 at 15:14 +0900, Damien Le Moal wrote: > + return kzalloc_node(BITS_TO_LONGS(sdkp->nr_zones) > + * sizeof(unsigned long), Does this perhaps fit on one line? > +/** > + * sd_zbc_get_seq_zones - Parse report zones reply to identify sequential > zones

Re: [PATCH V5 06/14] block: Add zoned block device information to request queue

2017-09-25 Thread Bart Van Assche
zed by stacking drivers (device mappers) handling zoned block > devices (e.g. dm-linear). Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH V5 03/14] scsi: sd_zbc: Rearrange code

2017-09-25 Thread Bart Van Assche
check_zone_size(). > > No functional change is introduced by this patch. > > Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> > Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH 1/5] block: don't call blk_mq_delay_run_hw_queue() in case of BLK_STS_RESOURCE

2017-09-19 Thread Bart Van Assche
On Wed, 2017-09-20 at 06:44 +0800, Ming Lei wrote: > For this issue, it isn't same between SCSI and dm-rq. > > We don't need to run queue in .end_io of dm, and the theory is > simple, otherwise it isn't performance issue, and should be I/O hang. > > 1) every dm-rq's request is 1:1 mapped to

Re: [PATCH 1/5] block: don't call blk_mq_delay_run_hw_queue() in case of BLK_STS_RESOURCE

2017-09-19 Thread Bart Van Assche
On Wed, 2017-09-20 at 00:55 +0800, Ming Lei wrote: > On Wed, Sep 20, 2017 at 12:49 AM, Bart Van Assche > <bart.vanass...@wdc.com> wrote: > > On Wed, 2017-09-20 at 00:04 +0800, Ming Lei wrote: > > > Run queue at end_io is definitely wrong, because blk-mq has SCHED_RESTA

Re: [PATCH 1/5] block: don't call blk_mq_delay_run_hw_queue() in case of BLK_STS_RESOURCE

2017-09-19 Thread Bart Van Assche
On Wed, 2017-09-20 at 00:04 +0800, Ming Lei wrote: > Run queue at end_io is definitely wrong, because blk-mq has SCHED_RESTART > to do that already. Sorry but I disagree. If SCHED_RESTART is set that causes the blk-mq core to reexamine the software queues and the hctx dispatch list but not the

Re: [PATCH 1/5] block: don't call blk_mq_delay_run_hw_queue() in case of BLK_STS_RESOURCE

2017-09-19 Thread Bart Van Assche
On Tue, 2017-09-19 at 11:48 -0400, Mike Snitzer wrote: > This thread proves that it is definitely brittle to be relying on fixed > delays like this: > https://patchwork.kernel.org/patch/9703249/ Hello Mike, Sorry but I think that's a misinterpretation of my patch. I came up with that patch

Re: [PATCH 1/5] block: don't call blk_mq_delay_run_hw_queue() in case of BLK_STS_RESOURCE

2017-09-19 Thread Bart Van Assche
On Tue, 2017-09-19 at 13:43 +0800, Ming Lei wrote: > On Mon, Sep 18, 2017 at 03:18:16PM +0000, Bart Van Assche wrote: > > If you are still looking at removing the blk_mq_delay_run_hw_queue() calls > > then I think you are looking in the wrong direction. What kind of problem >

Re: [PATCH 1/5] block: don't call blk_mq_delay_run_hw_queue() in case of BLK_STS_RESOURCE

2017-09-18 Thread Bart Van Assche
On Sun, 2017-09-17 at 20:40 +0800, Ming Lei wrote: > "if no request has completed before the delay has expired" can't be a > reason to rerun the queue, because the queue can still be busy. That statement of you shows that there are important aspects of the SCSI core and dm-mpath driver that you

Re: [PATCH V3 06/12] scsi: sd_zbc: Rearrange code

2017-09-15 Thread Bart Van Assche
On Sat, 2017-09-16 at 07:35 +0900, Damien Le Moal wrote: > rw16 is mandatory for ZBC drives. So it has to be set to true. If the > HBA does not support rw16 (why would that happen ?), then the disk > should not be used. It's good that all HBAs support rw16. But it's nontrivial to analyze whether

Re: [PATCH V3 06/12] scsi: sd_zbc: Rearrange code

2017-09-15 Thread Bart Van Assche
On Fri, 2017-09-15 at 19:51 +0200, h...@lst.de wrote: > On Fri, Sep 15, 2017 at 02:51:03PM +0000, Bart Van Assche wrote: > > On Fri, 2017-09-15 at 19:06 +0900, Damien Le Moal wrote: > > > Rearrange sd_zbc_setup() to include use_16_for_rw and use_10_for_rw > > > assignmen

Re: [PATCH 1/5] block: don't call blk_mq_delay_run_hw_queue() in case of BLK_STS_RESOURCE

2017-09-15 Thread Bart Van Assche
On Sat, 2017-09-16 at 00:44 +0800, Ming Lei wrote: > If .queue_rq() returns BLK_STS_RESOURCE, blk-mq will rerun > the queue in the three situations: > > 1) if BLK_MQ_S_SCHED_RESTART is set > - queue is rerun after one rq is completed, see blk_mq_sched_restart() > which is run from

Re: [PATCH V3 07/12] scsi: sd_zbc: Use well defined macros

2017-09-15 Thread Bart Van Assche
On Fri, 2017-09-15 at 19:06 +0900, Damien Le Moal wrote: > instead of open coding, use the min() macro to calculate a report zones > reply buffer length in sd_zbc_check_zone_size() and the round_up() > macro for calculating the number of zones in sd_zbc_setup(). Reviewed-by: Bart V

Re: [PATCH V3 10/12] scsi: sd_zbc: Limit zone write locking to sequential zones

2017-09-15 Thread Bart Van Assche
On Fri, 2017-09-15 at 19:06 +0900, Damien Le Moal wrote: > + * There is no write constraints on conventional zones. So any write ^^^ Should this have been "There are no"? > - if (sdkp->zones_wlock && > - test_and_set_bit(zno, sdkp->zones_wlock)) > + if

Re: [PATCH V2] megaraid: kmemleak: Track page allocation for fusion

2017-09-15 Thread Bart Van Assche
should have told you. Anyway: Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH V3 06/12] scsi: sd_zbc: Rearrange code

2017-09-15 Thread Bart Van Assche
On Fri, 2017-09-15 at 19:06 +0900, Damien Le Moal wrote: > Rearrange sd_zbc_setup() to include use_16_for_rw and use_10_for_rw > assignments and move the calculation of sdkp->zone_shift together > with the assignment of the verified zone_blocks value in > sd_zbc_check_zone_size(). Both functions

Re: [PATCH V3 03/12] block: Add zoned block device information to request queue

2017-09-15 Thread Bart Van Assche
On Fri, 2017-09-15 at 19:06 +0900, Damien Le Moal wrote: > @@ -492,6 +497,10 @@ struct request_queue { > struct blk_integrity integrity; > #endif /* CONFIG_BLK_DEV_INTEGRITY */ > > +#ifdef CONFIG_BLK_DEV_ZONED > + struct blk_zonedzoned; > +#endif > + > #ifdef CONFIG_PM

Re: [PATCH V3 02/12] block: Fix declaration of blk-mq scheduler functions

2017-09-15 Thread Bart Van Assche
On Fri, 2017-09-15 at 19:06 +0900, Damien Le Moal wrote: > The functions blk_mq_sched_free_hctx_data(), blk_mq_sched_try_merge(), > blk_mq_sched_try_insert_merge() and blk_mq_sched_request_inserted() are > all exported symbols but are declared only internally in > block/blk-mq-sched.h. Move these

Re: [PATCH V3 01/12] block: Fix declaration of blk-mq debugfs functions

2017-09-15 Thread Bart Van Assche
; structure to allow scheduler modules outside of the block directory to > define debugfs attributes. The title of this patch is "Fix declaration of ...". Should the title perhaps have been "Move declarations of ..."? Anyway: Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH 2/2] sg: fixup infoleak when using SG_GET_REQUEST_TABLE

2017-09-15 Thread Bart Van Assche
wed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH 1/2] sg: factor out sg_fill_request_table()

2017-09-15 Thread Bart Van Assche
On Fri, 2017-09-15 at 14:05 +0200, Hannes Reinecke wrote: > Factor our sg_fill_request_table() for better readability. Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH V4 08/10] block: allow to allocate req with RQF_PREEMPT when queue is preempt frozen

2017-09-14 Thread Bart Van Assche
On Thu, 2017-09-14 at 09:15 +0800, Ming Lei wrote: > On Wed, Sep 13, 2017 at 07:07:53PM +0000, Bart Van Assche wrote: > > On Thu, 2017-09-14 at 01:48 +0800, Ming Lei wrote: > > > No, that patch only changes blk_insert_cloned_request() which is used > > > by dm-rq

Re: [PATCH] megaraid: kmemleak: Track page allocation for fusion

2017-09-14 Thread Bart Van Assche
On Thu, 2017-09-14 at 14:16 +0800, shuw...@redhat.com wrote: > diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c > b/drivers/scsi/megaraid/megaraid_sas_fusion.c > index 11bd2e698b84..621299edd8de 100644 > --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c > +++

Re: [PATCH V4 08/10] block: allow to allocate req with RQF_PREEMPT when queue is preempt frozen

2017-09-13 Thread Bart Van Assche
On Thu, 2017-09-14 at 01:48 +0800, Ming Lei wrote: > No, that patch only changes blk_insert_cloned_request() which is used > by dm-rq(mpath) only, nothing to do with the reported issue during > suspend and sending SCSI Domain validation. There may be other ways to fix the SCSI domain validation

Re: [PATCH] scsi: Remove unnecessary condition in sd_read_block_limits()

2017-09-13 Thread Bart Van Assche
: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH V4 08/10] block: allow to allocate req with RQF_PREEMPT when queue is preempt frozen

2017-09-13 Thread Bart Van Assche
On Thu, 2017-09-14 at 00:48 +0800, Ming Lei wrote: > Could you please let me know if your concern about race between > preempt freeze and blk_cleanup_queue() is addressed in my last > reply? Shouldn't we wait until v4.13-rc1 has been released before spending more energy on this? Certain patches

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