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

2017-10-17 Thread Hannes Reinecke
On 10/17/2017 10:18 PM, Bart Van Assche wrote: > On Tue, 2017-10-17 at 08:33 +0200, Hannes Reinecke wrote: >> How do you ensure that PREEMPT requests are not stuck in the queue >> _behind_ non-PREEMPT requests? >> Once they are in the queue the request are already allocated, so your >> deferred

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

2017-10-17 Thread Jens Axboe
On 10/17/2017 05:40 PM, Bart Van Assche wrote: > On Tue, 2017-10-17 at 17:28 -0600, Jens Axboe wrote: >> On 10/17/2017 05:26 PM, Bart Van Assche wrote: >>> It is known that during the resume following a hibernate, especially when >>> using an md RAID1 array created on top of SCSI devices,

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

2017-10-17 Thread Bart Van Assche
On Tue, 2017-10-17 at 17:28 -0600, Jens Axboe wrote: > On 10/17/2017 05:26 PM, Bart Van Assche wrote: > > 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

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

2017-10-17 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 v10 05/10] block: Introduce blk_get_request_flags()

2017-10-17 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 Reviewed-by: Hannes Reinecke Tested-by: Martin

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

2017-10-17 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 v10 09/10] block, scsi: Make SCSI quiesce and resume work reliably

2017-10-17 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 v10 00/10] block, scsi, md: Improve suspend and resume

2017-10-17 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 v10 03/10] md: Neither resync nor reshape while the system is frozen

2017-10-17 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 v10 04/10] block: Make q_usage_counter also track legacy requests

2017-10-17 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 v10 06/10] block: Introduce BLK_MQ_REQ_PREEMPT

2017-10-17 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 Reviewed-by: Hannes Reinecke Tested-by: Martin Steigerwald Cc: Christoph Hellwig Cc: Ming Lei

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

2017-10-17 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 Reviewed-by: Hannes Reinecke

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

2017-10-17 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 Reviewed-by: Hannes Reinecke Tested-by:

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

2017-10-17 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

Re: [PATCH] kyber: fix hang on domain token wait queue

2017-10-17 Thread Jens Axboe
On 10/11/2017 11:39 AM, Omar Sandoval wrote: > From: Omar Sandoval > > When we're getting a domain token, if we fail to get a token on our > first attempt, we put the current hardware queue on a wait queue and > then try again just in case a token was freed after our initial

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

2017-10-17 Thread Bart Van Assche
On Tue, 2017-10-17 at 08:43 +0800, Ming Lei wrote: > On Mon, Oct 16, 2017 at 04:29:04PM -0700, Bart Van Assche wrote: > > [ ... ] > > int > > scsi_device_quiesce(struct scsi_device *sdev) > > { > > + struct request_queue *q = sdev->request_queue; > > int err; > > > > + /* > > +*

Re: high overhead of functions blkg_*stats_* in bfq

2017-10-17 Thread Jens Axboe
On 10/17/2017 10:45 AM, Linus Walleij wrote: > On Tue, Oct 17, 2017 at 2:45 PM, Paolo Valente > wrote: > >> one of the most time-consuming operations needed by some blkg_*stats_* >> functions is, e.g., find_next_bit, for which we don't see any trivial >> replacement. >

Re: high overhead of functions blkg_*stats_* in bfq

2017-10-17 Thread Linus Walleij
On Tue, Oct 17, 2017 at 2:45 PM, Paolo Valente wrote: > one of the most time-consuming operations needed by some blkg_*stats_* > functions is, e.g., find_next_bit, for which we don't see any trivial > replacement. So this is one of the things that often falls down to a

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

2017-10-17 Thread Jens Axboe
On 10/17/2017 10:09 AM, Jens Axboe wrote: > On 10/16/2017 06:03 PM, Kees Cook wrote: >> 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

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

2017-10-17 Thread Jens Axboe
On 10/16/2017 06:03 PM, Kees Cook wrote: > 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()

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

2017-10-17 Thread John Garry
On 17/10/2017 06:12, Ming Lei wrote: 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

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

2017-10-17 Thread Bart Van Assche
On Tue, 2017-10-17 at 08:14 +0200, Hannes Reinecke wrote: > On 10/17/2017 12:49 AM, Bart Van Assche wrote: > > [ ... ] > > void target_free_sgl(struct scatterlist *sgl, int nents) > > { > > - struct scatterlist *sg; > > - int count; > > - > > - for_each_sg(sgl, sg, nents, count) > > -

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

2017-10-17 Thread Bart Van Assche
On Tue, 2017-10-17 at 08:21 +0200, Hannes Reinecke wrote: > On 10/17/2017 12:49 AM, Bart Van Assche wrote: > > Signed-off-by: Bart Van Assche > > Reviewed-by: Johannes Thumshirn > > Cc: linux-s...@vger.kernel.org > > Cc: Martin K. Petersen

Re: high overhead of functions blkg_*stats_* in bfq

2017-10-17 Thread Paolo Valente
+Ulf Hansson, Mark Brown, Linus Walleij > Il giorno 17 ott 2017, alle ore 12:11, Paolo Valente > ha scritto: > > Hi Tejun, all, > in our work for reducing bfq overhead, we bumped into an unexpected > fact: the functions blkg_*stats_*, invoked in bfq to update cgroups

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

2017-10-17 Thread Ming Lei
On Tue, Oct 17, 2017 at 08:33:36AM +0200, Hannes Reinecke wrote: > On 10/17/2017 01:29 AM, 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. > > *

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

2017-10-17 Thread Ming Lei
On Tue, Oct 17, 2017 at 08:38:01AM +0200, Hannes Reinecke wrote: > On 10/17/2017 03:29 AM, Ming Lei wrote: > > 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: >

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

2017-10-17 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham

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

2017-10-17 Thread Johannes Thumshirn
Thanks Bart, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham

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

2017-10-17 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

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

2017-10-17 Thread Hannes Reinecke
On 10/17/2017 03:29 AM, Ming Lei wrote: > 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,

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

2017-10-17 Thread Hannes Reinecke
On 10/17/2017 01:29 AM, Bart Van Assche wrote: > 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

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

2017-10-17 Thread Hannes Reinecke
On 10/17/2017 01:32 AM, 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 patch does not change

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

2017-10-17 Thread Hannes Reinecke
On 10/17/2017 01:29 AM, 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 scsi_bus_pm_ops. > > It

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

2017-10-17 Thread Hannes Reinecke
On 10/17/2017 01:29 AM, Bart Van Assche wrote: > 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

Re: [PATCH v9 06/10] block: Introduce BLK_MQ_REQ_PREEMPT

2017-10-17 Thread Hannes Reinecke
On 10/17/2017 01:29 AM, Bart Van Assche wrote: > 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

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

2017-10-17 Thread Hannes Reinecke
On 10/17/2017 01:29 AM, Bart Van Assche wrote: > 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 >

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

2017-10-17 Thread Hannes Reinecke
On 10/17/2017 01:28 AM, Bart Van Assche wrote: > 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 > [

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

2017-10-17 Thread Hannes Reinecke
On 10/17/2017 01:28 AM, 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 requests stops before a hibernation image is created, > interrupt the md resync and reshape actions if the

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

2017-10-17 Thread Hannes Reinecke
On 10/17/2017 01:28 AM, Bart Van Assche wrote: > 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 >

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

2017-10-17 Thread Hannes Reinecke
On 10/17/2017 01:28 AM, Bart Van Assche wrote: > 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

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

2017-10-17 Thread Hannes Reinecke
On 10/17/2017 12:49 AM, Bart Van Assche wrote: > 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 >

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

2017-10-17 Thread Hannes Reinecke
On 10/17/2017 12:49 AM, Bart Van Assche wrote: > Signed-off-by: Bart Van Assche > Reviewed-by: Johannes Thumshirn > Cc: linux-s...@vger.kernel.org > Cc: Martin K. Petersen > Cc: Anil Ravindranath

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

2017-10-17 Thread Hannes Reinecke
On 10/17/2017 12:49 AM, Bart Van Assche wrote: > 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 >

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

2017-10-17 Thread Hannes Reinecke
On 10/17/2017 12:49 AM, Bart Van Assche wrote: > 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:

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

2017-10-17 Thread Hannes Reinecke
On 10/17/2017 12:49 AM, Bart Van Assche wrote: > 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 >

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

2017-10-17 Thread Hannes Reinecke
On 10/17/2017 12:49 AM, Bart Van Assche wrote: > 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 >

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

2017-10-17 Thread Hannes Reinecke
On 10/17/2017 12:49 AM, Bart Van Assche wrote: > 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 > ---

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

2017-10-17 Thread Hannes Reinecke
On 10/17/2017 12:49 AM, Bart Van Assche wrote: > 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