Re: [PATCH 5/7] scsi: return blk_status_t from scsi_init_io and ->init_command

2018-11-09 Thread Bart Van Assche
On Fri, 2018-11-09 at 14:42 +0100, Christoph Hellwig wrote: > Replace the old BLKRREP_* values with the BLK_STS_ ones that they are > converted to later anyway. Reviewed-by: Bart Van Assche

Re: [PATCH 4/7] scsi: clean up error handling in scsi_init_io

2018-11-09 Thread Bart Van Assche
On Fri, 2018-11-09 at 14:42 +0100, Christoph Hellwig wrote: > There is no need to call scsi_mq_free_sgtables until we have actually > allocated sgtables. Reviewed-by: Bart Van Assche

Re: [PATCH 3/7] scsi: push blk_status_t up into scsi_setup_{fs,scsi}_cmnd

2018-11-09 Thread Bart Van Assche
On Fri, 2018-11-09 at 14:42 +0100, Christoph Hellwig wrote: > This just moves the prep_to_mq calls up in preparation of further removal > of BLKPREP_* usage. Reviewed-by: Bart Van Assche

Re: [PATCH 1/7] ide: cleanup ->prep_rq calling convention

2018-11-09 Thread Bart Van Assche
On Fri, 2018-11-09 at 14:42 +0100, Christoph Hellwig wrote: > The return value is just used as a binary yes/no decicsion, so switch > it to a bool instead of the old BLKPREP_* values returned as an int. Reviewed-by: Bart Van Assche

Re: [PATCH 2/7] scsi: simplify scsi_prep_state_check

2018-11-09 Thread Bart Van Assche
On Fri, 2018-11-09 at 14:42 +0100, Christoph Hellwig wrote: > Return a blk_status_t directly, and make the code a little more compact > by handling the fast path in the caller. Reviewed-by: Bart Van Assche

Re: [PATCH 3/6] skd_main: don't use req->special

2018-11-09 Thread Bart Van Assche
On 11/9/18 10:32 AM, Christoph Hellwig wrote: Add a retries field to the internal request structure instead, which gets set to zero on the first submission. Signed-off-by: Christoph Hellwig --- drivers/block/skd_main.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git

Re: [PATCH 1/2] blk-mq-tag: change busy_iter_fn to return whether to continue or not

2018-11-08 Thread Bart Van Assche
On Thu, 2018-11-08 at 10:50 -0700, Jens Axboe wrote: > How about this incremental? > > diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c > index 097e9a67d5f5..87bc5df72d48 100644 > --- a/block/blk-mq-tag.c > +++ b/block/blk-mq-tag.c > @@ -248,7 +248,8 @@ static bool bt_iter(struct sbitmap *bitm

Re: [PATCH 1/2] blk-mq-tag: change busy_iter_fn to return whether to continue or not

2018-11-08 Thread Bart Van Assche
On Thu, 2018-11-08 at 09:31 -0700, Jens Axboe wrote: > On 11/8/18 9:28 AM, Bart Van Assche wrote: > > On Thu, 2018-11-08 at 09:06 -0700, Jens Axboe wrote: > > > --- a/block/blk-mq-debugfs.c > > > +++ b/block/blk-mq-debugfs.c > > > @@ -424,13 +424,15 @@ struct sh

Re: [PATCH 2/2] blk-mq: provide a helper to check if a queue is busy

2018-11-08 Thread Bart Van Assche
; + * to stop the iteration. > + */ > + if (rq->q == hctx->queue) { > + bool *busy = (bool *) priv; I think the "(bool *)" cast can be left out. Anyway: Reviewed-by: Bart Van Assche

Re: [PATCH 1/2] blk-mq-tag: change busy_iter_fn to return whether to continue or not

2018-11-08 Thread Bart Van Assche
On Thu, 2018-11-08 at 09:06 -0700, Jens Axboe wrote: > --- a/block/blk-mq-debugfs.c > +++ b/block/blk-mq-debugfs.c > @@ -424,13 +424,15 @@ struct show_busy_params { > * Note: the state of a request may change while this function is in > progress, > * e.g. due to a concurrent blk_mq_finish_requ

Re: [PATCH] block: respect virtual boundary mask in bvecs

2018-11-07 Thread Bart Van Assche
On Tue, 2018-11-06 at 19:30 -0800, Sagi Grimberg wrote: > > > How about changing that expression into the following to make it easier > > > for the compiler to optimize this code? > > > > > > (offset | (bprv->bv_offset + bprv->bv_len)) & queue_virt_boundary(q) > > > > Uhm I have to admit I'm not

Re: [PATCH] block: respect virtual boundary mask in bvecs

2018-11-06 Thread Bart Van Assche
On 11/5/18 2:23 AM, Johannes Thumshirn wrote: @@ -169,7 +169,7 @@ static inline bool biovec_phys_mergeable(struct request_queue *q, static inline bool __bvec_gap_to_prev(struct request_queue *q, struct bio_vec *bprv, unsigned int offset) { - return offset || + ret

Re: [PATCH blktests] fix discontiguous-io compile error on 32 bit systems

2018-11-05 Thread Bart Van Assche
On 11/5/18 6:19 PM, yuyufen wrote: I am sorry that I did not see the discussion before this. And you are right. Please ignore this patch. Don't worry - this can happen :-) Bart.

Re: [PATCH 0/2] loop: Better discard for block devices

2018-11-02 Thread Bart Van Assche
On Thu, 2018-11-01 at 15:44 -0700, Gwendal Grignou wrote: > On Thu, Nov 1, 2018 at 11:15 AM Evan Green wrote: > > > > On Tue, Oct 30, 2018 at 4:50 PM Bart Van Assche wrote: > > > > > > On Tue, 2018-10-30 at 16:06 -0700, Evan Green wrote: > > > >

Re: [PATCH blktests] fix discontiguous-io compile error on 32 bit systems

2018-11-01 Thread Bart Van Assche
On Thu, 2018-11-01 at 14:35 +0800, Yufen Yu wrote: > When make discontiguous-io.cpp with -m32, g++ compiler reports > error for std::min(long unsigned int, size_t) has diffent > arguments type. > > fixes: fd21728886e7 ("Add the discontiguous-io test program") > Signed-off-by: Yufen Yu > --- > sr

Re: remove exofs and the T10 OSD code V2

2018-10-31 Thread Bart Van Assche
On Wed, 2018-10-31 at 18:34 +0200, Boaz Harrosh wrote: > On 27/10/18 11:20, Christoph Hellwig wrote: > > The only real user of the T10 OSD protocol, the pNFS object layout > > driver never went to the point of having shipping products, and we > > removed it 1.5 years ago. Exofs is just a simple ex

Re: [PATCH 0/2] loop: Better discard for block devices

2018-10-30 Thread Bart Van Assche
On Tue, 2018-10-30 at 16:06 -0700, Evan Green wrote: > This series addresses some errors seen when using the loop > device directly backed by a block device. The first change plumbs > out the correct error message, and the second change prevents the > error from occurring in many cases. Hi Evan,

Re: [PATCH blktests -v2] Fix build failure for discontiguous-io on 32-bit platforms

2018-10-30 Thread Bart Van Assche
On Tue, 2018-10-30 at 12:02 -0400, Theodore Y. Ts'o wrote: > On Tue, Oct 30, 2018 at 08:02:55AM -0700, Bart Van Assche wrote: > > Details about how the build fails on 32-bit systems would have been welcome > > in the commit message. Anyway: > > > > Reviewed-b

Re: [PATCH blktests -v2] Fix build failure for discontiguous-io on 32-bit platforms

2018-10-30 Thread Bart Van Assche
> while ((c = getopt(argc, argv, "hl:o:sw")) != EOF) { > switch (c) { Details about how the build fails on 32-bit systems would have been welcome in the commit message. Anyway: Reviewed-by: Bart Van Assche

Re: [PATCH blktests] Fix build failure for discontiguous-io on 32-bit platforms

2018-10-29 Thread Bart Van Assche
On Mon, 2018-10-29 at 17:08 -0400, Theodore Y. Ts'o wrote: > On Mon, Oct 29, 2018 at 09:26:43AM -0700, Bart Van Assche wrote: > > > > Have you considered to change the data type of 'len' from size_t into > > unsigned long > > instead of inserting t

Re: [PATCH 2/2] scsi: remove the SCSI OSD library

2018-10-29 Thread Bart Van Assche
On Sat, 2018-10-27 at 10:20 +0200, Christoph Hellwig wrote: > Now that all the users are gone the SCSI OSD library can be removed > as well. Reviewed-by: Bart Van Assche

Re: [PATCH 1/2] fs: remove exofs

2018-10-29 Thread Bart Van Assche
On Sat, 2018-10-27 at 10:20 +0200, Christoph Hellwig wrote: > This was an example for using the SCSI OSD protocol, which we're trying > to remove. Reviewed-by: Bart Van Assche

Re: [PATCH 10/14] blk-mq: initial support for multiple queue maps

2018-10-29 Thread Bart Van Assche
On Mon, 2018-10-29 at 14:09 -0600, Jens Axboe wrote: > hctx->type will be set to the value of the first type. This is all driver > private, blk-mq could not care less what the value of the type means. > > As to the other question, it works just fine since that is the queue > that is being accessed

Re: [PATCH 10/14] blk-mq: initial support for multiple queue maps

2018-10-29 Thread Bart Van Assche
On Mon, 2018-10-29 at 13:53 -0600, Jens Axboe wrote: > On 10/29/18 1:40 PM, Bart Van Assche wrote: > > On Mon, 2018-10-29 at 10:37 -0600, Jens Axboe wrote: > > > -static int cpu_to_queue_index(unsigned int nr_queues, const int cpu) > > > +static int cpu_to_queue_index(st

Re: [PATCH 10/14] blk-mq: initial support for multiple queue maps

2018-10-29 Thread Bart Van Assche
On Mon, 2018-10-29 at 10:37 -0600, Jens Axboe wrote: > -static int cpu_to_queue_index(unsigned int nr_queues, const int cpu) > +static int cpu_to_queue_index(struct blk_mq_queue_map *qmap, > + unsigned int nr_queues, const int cpu) > { > - return cpu % nr_queues; > +

Re: [PATCH 09/14] blk-mq: ensure that plug lists don't straddle hardware queues

2018-10-29 Thread Bart Van Assche
On Mon, 2018-10-29 at 10:37 -0600, Jens Axboe wrote: > void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule) > { > struct blk_mq_ctx *this_ctx; > @@ -1628,7 +1649,7 @@ void blk_mq_flush_plug_list(struct blk_plug *plug, bool > from_schedule) > struct request *rq; >

Re: [PATCH 02/14] blk-mq: abstract out queue map

2018-10-29 Thread Bart Van Assche
ewed a later patch in this series. Anyway: Reviewed-by: Bart Van Assche

Re: [PATCH 08/14] blk-mq: separate number of hardware queues from nr_cpu_ids

2018-10-29 Thread Bart Van Assche
; + * Maximum number of queues we support. For single sets, we'll never have ^ hardware? > + * more than the CPUs (software queues). For multiple sets, the tag_set > + * user may have set ->nr_hw_queues larger. > + */ Anyway: Reviewed-by: Bart Van Assche

Re: [PATCH 07/14] blk-mq: support multiple hctx maps

2018-10-29 Thread Bart Van Assche
On Mon, 2018-10-29 at 10:37 -0600, Jens Axboe wrote: > -static inline struct blk_mq_hw_ctx *blk_mq_map_queue(struct request_queue *q, > - unsigned int flags, > - int cpu) > +static inline struct blk_mq

Re: [PATCH 06/14] blk-mq: add 'type' attribute to the sysfs hctx directory

2018-10-29 Thread Bart Van Assche
On Mon, 2018-10-29 at 10:37 -0600, Jens Axboe wrote: > It can be useful for a user to verify what type a given hardware > queue is, expose this information in sysfs. Reviewed-by: Bart Van Assche

Re: [PATCH 05/14] blk-mq: allow software queue to map to multiple hardware queues

2018-10-29 Thread Bart Van Assche
On Mon, 2018-10-29 at 10:37 -0600, Jens Axboe wrote: > The mapping used to be dependent on just the CPU location, but > now it's a tuple of { type, cpu} instead. This is a prep patch > for allowing a single software queue to map to multiple hardware > queues. No functional changes in this patch. A

Re: [PATCH 04/14] blk-mq: pass in request/bio flags to queue mapping

2018-10-29 Thread Bart Van Assche
On Mon, 2018-10-29 at 10:37 -0600, Jens Axboe wrote: > @@ -400,9 +402,15 @@ void blk_mq_sched_insert_requests(struct request_queue > *q, > struct blk_mq_ctx *ctx, > struct list_head *list, bool run_queue_async) > { > - struct blk

Re: [PATCH 03/14] blk-mq: provide dummy blk_mq_map_queue_type() helper

2018-10-29 Thread Bart Van Assche
On Mon, 2018-10-29 at 10:37 -0600, Jens Axboe wrote: > diff --git a/block/blk-mq.h b/block/blk-mq.h > index 889f0069dd80..79c300faa7ce 100644 > --- a/block/blk-mq.h > +++ b/block/blk-mq.h > @@ -80,6 +80,12 @@ static inline struct blk_mq_hw_ctx > *blk_mq_map_queue(struct request_queue *q, > r

Re: [PATCH 01/14] blk-mq: kill q->mq_map

2018-10-29 Thread Bart Van Assche
at it is clear that that move is intentional. Anyway: Reviewed-by: Bart Van Assche

Re: [PATCH blktests] Fix build failure for discontiguous-io on 32-bit platforms

2018-10-29 Thread Bart Van Assche
On Mon, 2018-10-29 at 12:15 -0400, Theodore Ts'o wrote: > Signed-off-by: Theodore Ts'o > --- > src/discontiguous-io.cpp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/discontiguous-io.cpp b/src/discontiguous-io.cpp > index 5e0ee0f..a59c18d 100644 > --- a/src/discont

Re: [PATCH] floppy: Avoid memory access beyond the array bounds in setup_rw_floppy()

2018-10-26 Thread Bart Van Assche
On Fri, 2018-10-26 at 10:39 -0400, Kyungtae Kim wrote: > setup_rw_floppy() writes some bytes of array cmd to the floppy disk > controller, depending on cmd_count. > Although the size of array cmd is fixed like 16, cmd_count can be much > larger through raw_cmd_ioctl(). > Noticed there is no bound c

Re: [PATCH 05/28] IB/srp: remove old request_fn_active check

2018-10-26 Thread Bart Van Assche
On Fri, 2018-10-26 at 08:32 -0600, Jens Axboe wrote: > On 10/26/18 1:08 AM, Hannes Reinecke wrote: > > On 10/25/18 11:10 PM, Jens Axboe wrote: > > > This check is only viable for non scsi-mq. Since that is going away, > > > kill this legacy check. > > > > &

Re: [PATCHSET 0/28] blk-mq driver conversions and legacy path removal

2018-10-25 Thread Bart Van Assche
On Thu, 2018-10-25 at 15:10 -0600, Jens Axboe wrote: > The first round of this went into 4.20-rc, but we've still some of > them pending. This patch series converts the remaining drivers to > blk-mq. The ones that support dual paths (like SCSI and DM) have > the non-mq path removed. At the end, leg

Re: [PATCH 23/28] block: kill lld busy

2018-10-25 Thread Bart Van Assche
On Thu, 2018-10-25 at 15:10 -0600, Jens Axboe wrote: > Nobody sets the helper, so we always return 0. Kill it. How about changing the description of this patch into something like "Now that the blk_lld_busy() and blk_queue_lld_busy() callers have been removed, also remove the implementations of th

Re: [PATCH 08/28] scsi: kill off the legacy IO path

2018-10-25 Thread Bart Van Assche
On Thu, 2018-10-25 at 15:10 -0600, Jens Axboe wrote: > @@ -3265,25 +3261,17 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct > pci_device_id *id) > base_vha->mgmt_svr_loop_id, host->sg_tablesize); > > if (ha->mqenable) { > - bool mq = false; > boo

Re: [PATCH 05/28] IB/srp: remove old request_fn_active check

2018-10-25 Thread Bart Van Assche
On Thu, 2018-10-25 at 15:10 -0600, Jens Axboe wrote: > This check is only viable for non scsi-mq. Since that is going away, > kill this legacy check. > > Cc: Bart Van Assche > Cc: Parav Pandit > Cc: linux-s...@vger.kernel.org > Signed-off-by: Jens Axboe > --- >

Re: [PATCH v4 00/11] Zoned block device support improvements

2018-10-24 Thread Bart Van Assche
On Wed, 2018-10-24 at 11:37 -0400, Martin K. Petersen wrote: > Mike, > > > > You keep mentioning this, but I don't recall ever seeing anything to > > > that effect. The rest of the kernel appears to be either arbitrary > > > ordering or favoring author SoB as the first tag. > > > > I've always fe

Re: [PATCH 2/5] block: move .dma_alignment into q->limits

2018-10-18 Thread Bart Van Assche
be perceptible ^ ^^^ immutable?observable? > by stack driver, so IO buffer can be allocated as dma aligned before ^ stacked? Anyway: Reviewed-by: Bart Van Assche

Re: [PATCH 0/5] block: introduce helpers for allocating io buffer from slab

2018-10-18 Thread Bart Van Assche
On Thu, 2018-10-18 at 07:03 -0700, Matthew Wilcox wrote: > On Thu, Oct 18, 2018 at 09:18:12PM +0800, Ming Lei wrote: > > Filesystems may allocate io buffer from slab, and use this buffer to > > submit bio. This way may break storage drivers if they have special > > requirement on DMA alignment. >

Re: [PATCH v2] block: BFQ default for single queue devices

2018-10-17 Thread Bart Van Assche
On 10/17/18 3:05 AM, Jan Kara wrote: Well, the problem with this is that big distro people really don't care much because they already use udev for tuning the IO scheduler. So whatever defaults the kernel is going to pick likely won't be seen by distro customers. Embedded people seem to be drivin

Re: [PATCH v2] block: BFQ default for single queue devices

2018-10-15 Thread Bart Van Assche
On Mon, 2018-10-15 at 16:10 +0200, Linus Walleij wrote: > + * For blk-mq devices, we default to using: > + * - "none" for multiqueue devices (nr_hw_queues != 1) > + * - "bfq", if available, for single queue devices > + * - "mq-deadline" if "bfq" is not available for single queue devices > + * - "no

Re: [PATCHv5 0/3] Deprecate DAC960 driver

2018-10-12 Thread Bart Van Assche
On 10/12/18 12:15 AM, Hannes Reinecke wrote: Hi all, as we're trying to get rid of the remaining request_fn drivers here's a patchset to move the DAC960 driver to the SCSI stack. As per request from hch I've split up the driver into two new SCSI drivers called 'myrb' and 'myrs'. Hi Hannes, Ap

[PATCH] blk-mq-debugfs: Also show requests that have not yet been started

2018-10-04 Thread Bart Van Assche
When debugging e.g. the SCSI timeout handler it is important that requests that have not yet been started or that already have completed are also reported through debugfs. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Martin

Re: [PATCH] blk-mq-debugfs: Also show requests that have not yet been started

2018-10-03 Thread Bart Van Assche
On Wed, 2018-10-03 at 16:12 -0600, Jens Axboe wrote: > On 10/3/18 3:42 PM, Bart Van Assche wrote: > > On Fri, 2018-01-12 at 22:11 +0000, Bart Van Assche wrote: > > > /* > > > + * Show "busy" requests - these are the requests owned by the block > >

Re: [PATCH] blk-mq-debugfs: Also show requests that have not yet been started

2018-10-03 Thread Bart Van Assche
On Fri, 2018-01-12 at 22:11 +, Bart Van Assche wrote: > On Fri, 2018-01-12 at 15:05 -0700, Jens Axboe wrote: > > On 1/12/18 3:00 PM, Bart Van Assche wrote: > > > On Fri, 2018-01-12 at 14:55 -0700, Jens Axboe wrote: > > > > On 1/12/18 2:52 PM, Bart Van Assche wrote

[PATCH] block: Finish renaming REQ_DISCARD into REQ_OP_DISCARD

2018-10-03 Thread Bart Van Assche
From: Bart Van Assche Some time ago REQ_DISCARD was renamed into REQ_OP_DISCARD. Some comments and documentation files were not updated however. Update these comments and documentation files. See also commit 4e1b2d52a80d ("block, fs, drivers: remove REQ_OP compat defs and related code"

Re: [PATCH blktests 0/3] Add NVMeOF multipath tests

2018-09-27 Thread Bart Van Assche
On Tue, 2018-09-18 at 17:18 -0700, Omar Sandoval wrote: > On Tue, Sep 18, 2018 at 05:02:47PM -0700, Bart Van Assche wrote: > > On 9/18/18 4:24 PM, Omar Sandoval wrote: > > > On Tue, Sep 18, 2018 at 02:20:59PM -0700, Bart Van Assche wrote: > > > > Can you have a look a

Re: [PATCHv3 0/5] genhd: register default groups with device_add_disk()

2018-09-27 Thread Bart Van Assche
On Fri, 2018-09-21 at 07:48 +0200, Christoph Hellwig wrote: > Can you resend this with the one easy fixup pointed out? It would > be good to finally get the race fix merged. Seconded. I also would like to see these patches being merged upstream. Bart.

[PATCH v11 5/8] percpu-refcount: Introduce percpu_ref_resurrect()

2018-09-26 Thread Bart Van Assche
This function will be used in a later patch to switch the struct request_queue q_usage_counter from killed back to live. In contrast to percpu_ref_reinit(), this new function does not require that the refcount is zero. Signed-off-by: Bart Van Assche Acked-by: Tejun Heo Reviewed-by: Ming Lei Cc

[PATCH v11 4/8] block: Schedule runtime resume earlier

2018-09-26 Thread Bart Van Assche
patch that will make request allocation block while the queue status is not RPM_ACTIVE. Signed-off-by: Bart Van Assche Reviewed-by: Ming Lei Reviewed-by: Christoph Hellwig Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan Stern --- block/blk-core.c | 3 ++- block

[PATCH v11 8/8] blk-mq: Enable support for runtime power management

2018-09-26 Thread Bart Van Assche
Now that the blk-mq core processes power management requests (marked with RQF_PREEMPT) in other states than RPM_ACTIVE, enable runtime power management for blk-mq. Signed-off-by: Bart Van Assche Reviewed-by: Ming Lei Reviewed-by: Christoph Hellwig Cc: Jianchao Wang Cc: Hannes Reinecke Cc

[PATCH v11 7/8] block: Make blk_get_request() block for non-PM requests while suspended

2018-09-26 Thread Bart Van Assche
blk_get_request() callers are waiting. For blk-mq, instead of maintaining the q->nr_pending counter, rely on q->q_usage_counter. Call pm_runtime_mark_last_busy() every time a request finishes instead of only if the queue depth drops to zero. Signed-off-by: Bart Van Assche Reviewed-by: Mi

[PATCH v11 2/8] block, scsi: Change the preempt-only flag into a counter

2018-09-26 Thread Bart Van Assche
" mode as long as a block device is runtime suspended, make it possible to set "pm-only" mode from more than one context. Since with this change scsi_device_quiesce() is no longer idempotent, make that function return early if it is called for a quiesced queue. Signed-off-by: Bart Van

[PATCH v11 0/8] blk-mq: Implement runtime power management

2018-09-26 Thread Bart Van Assche
ode into a separate file. - Addressed Ming's feedback. Bart Van Assche (8): block: Move power management code into a new source file block, scsi: Change the preempt-only flag into a counter block: Split blk_pm_add_request() and blk_pm_put_request() block: Schedule runtime resume earlier

[PATCH v11 1/8] block: Move power management code into a new source file

2018-09-26 Thread Bart Van Assche
layer core code but also reduces the size of header file and hence should help to reduce the build time of the Linux kernel if CONFIG_PM is not defined. Signed-off-by: Bart Van Assche Reviewed-by: Ming Lei Reviewed-by: Christoph Hellwig Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes

[PATCH v11 6/8] block: Allow unfreezing of a queue while requests are in progress

2018-09-26 Thread Bart Van Assche
that the refcount it operates on is zero. Signed-off-by: Bart Van Assche Reviewed-by: Ming Lei Reviewed-by: Christoph Hellwig Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn --- block/blk-mq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-mq.c b/

[PATCH v11 3/8] block: Split blk_pm_add_request() and blk_pm_put_request()

2018-09-26 Thread Bart Van Assche
Move the pm_request_resume() and pm_runtime_mark_last_busy() calls into two new functions and thereby separate legacy block layer code from code that works for both the legacy block layer and blk-mq. A later patch will add calls to the new functions in the blk-mq code. Signed-off-by: Bart Van

Re: [PATCH v10 5/8] percpu-refcount: Introduce percpu_ref_resurrect()

2018-09-26 Thread Bart Van Assche
On Wed, 2018-09-26 at 09:59 -0700, Tejun Heo wrote: > Hello, Bart. > > On Mon, Sep 24, 2018 at 01:43:35PM -0700, Bart Van Assche wrote: > > Thanks for the review. But could you please clarify what "after ->percpu_ref > > is called" refers to? > > Oops, sor

Re: [PATCH v10 7/8] block: Make blk_get_request() block for non-PM requests while suspended

2018-09-26 Thread Bart Van Assche
On Wed, 2018-09-26 at 17:06 +0200, Johannes Thumshirn wrote: > On Wed, Sep 26, 2018 at 04:57:32PM +0200, Christoph Hellwig wrote: > > I don't think this actually works given that rpm_status only exists > > if CONFIG_PM is set. > > I think it'll work as GCC does constant propagation. There are > ac

Re: [PATCH v2] block: fix deadline elevator drain for zoned block devices

2018-09-26 Thread Bart Van Assche
On Wed, 2018-09-26 at 16:30 +0900, Damien Le Moal wrote: > diff --git a/block/elevator.c b/block/elevator.c > index 6a06b5d040e5..8cd81fd6339a 100644 > --- a/block/elevator.c > +++ b/block/elevator.c > @@ -609,7 +609,7 @@ void elv_drain_elevator(struct request_queue *q) > > while (e->type->

Re: [PATCH] blk-mq: Allow blocking queue tag iter callbacks

2018-09-25 Thread Bart Van Assche
On Tue, 2018-09-25 at 08:39 -0600, Keith Busch wrote: > On Tue, Sep 25, 2018 at 10:39:46AM +0800, jianchao.wang wrote: > > But the issue is the left part of blk_mq_timeout_work is moved out of > > protection of q refcount. > > I'm not sure what you mean by "left part". The only part that isn't >

Re: [PATCH] blk-mq: Allow blocking queue tag iter callbacks

2018-09-24 Thread Bart Van Assche
On 9/24/18 7:11 PM, jianchao.wang wrote: Hi Keith On 09/25/2018 05:09 AM, Keith Busch wrote: - /* A deadlock might occur if a request is stuck requiring a -* timeout at the same time a queue freeze is waiting -* completion, since the timeout code would not be able to -

Re: [PATCH v10 5/8] percpu-refcount: Introduce percpu_ref_resurrect()

2018-09-24 Thread Bart Van Assche
On Mon, 2018-09-24 at 11:01 -0700, Tejun Heo wrote: > Hello, Bart. > > On Fri, Sep 21, 2018 at 01:31:19PM -0700, Bart Van Assche wrote: > > +void percpu_ref_resurrect(struct percpu_ref *ref) > > +{ > > + unsigned long __percpu *percpu_count;

Re: Regression caused by f5bbbbe4d635

2018-09-24 Thread Bart Van Assche
On Mon, 2018-09-24 at 13:13 -0600, Keith Busch wrote: > diff --git a/block/blk-mq.c b/block/blk-mq.c > index 85a1c1a59c72..28d128450621 100644 > --- a/block/blk-mq.c > +++ b/block/blk-mq.c > @@ -848,22 +848,6 @@ static void blk_mq_timeout_work(struct work_struct *work) > struct blk_mq_hw_ctx

[PATCH v2] blk-mq: Document the functions that iterate over requests

2018-09-21 Thread Bart Van Assche
Make it easier to understand the purpose of the functions that iterate over requests by documenting their purpose. Fix several minor spelling and grammer mistakes in comments in these functions. Signed-off-by: Bart Van Assche Reviewed-by: Johannes Thumshirn Cc: Christoph Hellwig Cc: Ming Lei

[PATCH v10 8/8] blk-mq: Enable support for runtime power management

2018-09-21 Thread Bart Van Assche
Now that the blk-mq core processes power management requests (marked with RQF_PREEMPT) in other states than RPM_ACTIVE, enable runtime power management for blk-mq. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn

[PATCH v10 3/8] block: Split blk_pm_add_request() and blk_pm_put_request()

2018-09-21 Thread Bart Van Assche
Move the pm_request_resume() and pm_runtime_mark_last_busy() calls into two new functions and thereby separate legacy block layer code from code that works for both the legacy block layer and blk-mq. A later patch will add calls to the new functions in the blk-mq code. Signed-off-by: Bart Van

[PATCH v10 1/8] block: Move power management code into a new source file

2018-09-21 Thread Bart Van Assche
layer core code but also reduces the size of header file and hence should help to reduce the build time of the Linux kernel if CONFIG_PM is not defined. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan

[PATCH v10 7/8] block: Make blk_get_request() block for non-PM requests while suspended

2018-09-21 Thread Bart Van Assche
blk_get_request() callers are waiting. For blk-mq, instead of maintaining the q->nr_pending counter, rely on q->q_usage_counter. Call pm_runtime_mark_last_busy() every time a request finishes instead of only if the queue depth drops to zero. Signed-off-by: Bart Van Assche Cc: Christoph H

[PATCH v10 2/8] block, scsi: Change the preempt-only flag into a counter

2018-09-21 Thread Bart Van Assche
" mode as long as a block device is runtime suspended, make it possible to set "pm-only" mode from more than one context. Since with this change scsi_device_quiesce() is no longer idempotent, make that function return early if it is called for a quiesced queue. Signed-off-by: Bart Van A

[PATCH v10 5/8] percpu-refcount: Introduce percpu_ref_resurrect()

2018-09-21 Thread Bart Van Assche
This function will be used in a later patch to switch the struct request_queue q_usage_counter from killed back to live. In contrast to percpu_ref_reinit(), this new function does not require that the refcount is zero. Signed-off-by: Bart Van Assche Cc: Tejun Heo Cc: Christoph Hellwig Cc: Ming

[PATCH v10 6/8] block: Allow unfreezing of a queue while requests are in progress

2018-09-21 Thread Bart Van Assche
that the refcount it operates on is zero. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn --- block/blk-mq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-mq.c b/block/blk-mq.c

[PATCH v10 4/8] block: Schedule runtime resume earlier

2018-09-21 Thread Bart Van Assche
patch that will make request allocation block while the queue status is not RPM_ACTIVE. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan Stern --- block/blk-core.c | 3 ++- block/elevator.c | 1 - 2

[PATCH v10 0/8] blk-mq: Implement runtime power management

2018-09-21 Thread Bart Van Assche
the comment about runtime overhead of switching a per-cpu counter to atomic mode. Changes compared to v1: - Moved the runtime power management code into a separate file. - Addressed Ming's feedback. Bart Van Assche (8): block: Move power management code into a new source file block,

Re: [PATCH v9 1/8] blk-mq: Document the functions that iterate over requests

2018-09-20 Thread Bart Van Assche
On Thu, 2018-09-20 at 09:35 +0200, Johannes Thumshirn wrote: > On Wed, Sep 19, 2018 at 03:45:23PM -0700, Bart Van Assche wrote: > > +/* > > + * Call function @fn(@hctx, rq, @data, @reserved) for each request > > queued on > > + * @hctx that has been assigned a driv

Re: [PATCH v9 7/8] block: Make blk_get_request() block for non-PM requests while suspended

2018-09-20 Thread Bart Van Assche
On Thu, 2018-09-20 at 11:48 +0800, Ming Lei wrote: > On Wed, Sep 19, 2018 at 03:45:29PM -0700, Bart Van Assche wrote: > > + ret = -EBUSY; > > + if (blk_requests_in_flight(q) == 0) { > > + blk_freeze_queue_start(q); > > + /* > > +

[PATCH v9 4/8] block, scsi: Change the preempt-only flag into a counter

2018-09-19 Thread Bart Van Assche
" mode as long as a block device is runtime suspended, make it possible to set "pm-only" mode from more than one context. Since with this change scsi_device_quiesce() is no longer idempotent, make that function return early if it is called for a quiesced queue. Signed-off-by: Bart Van A

[PATCH v9 8/8] blk-mq: Enable support for runtime power management

2018-09-19 Thread Bart Van Assche
Now that the blk-mq core processes power management requests (marked with RQF_PREEMPT) in other states than RPM_ACTIVE, enable runtime power management for blk-mq. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn

[PATCH v9 6/8] block: Schedule runtime resume earlier

2018-09-19 Thread Bart Van Assche
patch that will make request allocation block while the queue status is not RPM_ACTIVE. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan Stern --- block/blk-core.c | 2 ++ block/elevator.c | 1 - 2 files

[PATCH v9 3/8] block: Move power management code into a new source file

2018-09-19 Thread Bart Van Assche
layer core code but also reduces the size of header file and hence should help to reduce the build time of the Linux kernel if CONFIG_PM is not defined. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan

[PATCH v9 5/8] block: Split blk_pm_add_request() and blk_pm_put_request()

2018-09-19 Thread Bart Van Assche
Move the pm_request_resume() and pm_runtime_mark_last_busy() calls into two new functions and thereby separate legacy block layer code from code that works for both the legacy block layer and blk-mq. A later patch will add calls to the new functions in the blk-mq code. Signed-off-by: Bart Van

[PATCH v9 1/8] blk-mq: Document the functions that iterate over requests

2018-09-19 Thread Bart Van Assche
Make it easier to understand the purpose of the functions that iterate over requests by documenting their purpose. Fix three minor spelling mistakes in comments in these functions. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc

[PATCH v9 7/8] block: Make blk_get_request() block for non-PM requests while suspended

2018-09-19 Thread Bart Van Assche
blk_get_request() callers are waiting. For blk-mq, instead of maintaining the q->nr_pending counter, rely on q->q_usage_counter. Call pm_runtime_mark_last_busy() every time a request finishes instead of only if the queue depth drops to zero. Signed-off-by: Bart Van Assche Cc: Christoph H

[PATCH v9 0/8] blk-mq: Implement runtime power management

2018-09-19 Thread Bart Van Assche
time power management code into a separate file. - Addressed Ming's feedback. Bart Van Assche (8): blk-mq: Document the functions that iterate over requests blk-mq: Introduce blk_mq_queue_rq_iter() block: Move power management code into a new source file block, scsi: Change the preempt

[PATCH v9 2/8] blk-mq: Introduce blk_mq_queue_rq_iter()

2018-09-19 Thread Bart Van Assche
This function will be used in the patch "Make blk_get_request() block for non-PM requests while suspended". Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan Stern --- block/blk-mq-

Re: [PATCH v8 6/8] block: Schedule runtime resume earlier

2018-09-19 Thread Bart Van Assche
On Wed, 2018-09-19 at 12:05 +0800, Ming Lei wrote: > Looks this patch may introduce the following race between queue > freeze and > runtime suspend: > > --- > --- > CPU0 CPU1 >

Re: [PATCH v7 5/6] block: Make blk_get_request() block for non-PM requests while suspended

2018-09-19 Thread Bart Van Assche
On Wed, 2018-09-19 at 10:21 +0800, jianchao.wang wrote: > On 09/19/2018 01:44 AM, Bart Van Assche wrote: > > There is only one blk_pm_request_resume() call and that call is > > inside blk_queue_enter() after the pm_only counter has been > > checked. > > > > For t

Re: [PATCH blktests 0/3] Add NVMeOF multipath tests

2018-09-18 Thread Bart Van Assche
On 9/18/18 4:24 PM, Omar Sandoval wrote: On Tue, Sep 18, 2018 at 02:20:59PM -0700, Bart Van Assche wrote: Can you have a look at the updated master branch of https://github.com/bvanassche/blktests? That code should no longer fail if unloading the nvme kernel module fails. Please note that you

Re: [PATCH blktests 0/3] Add NVMeOF multipath tests

2018-09-18 Thread Bart Van Assche
On 8/23/18 5:21 PM, Omar Sandoval wrote: On Thu, Aug 23, 2018 at 01:53:33AM +, Bart Van Assche wrote: On Tue, 2018-08-21 at 08:46 +0200, Johannes Thumshirn wrote: On Mon, Aug 20, 2018 at 03:46:45PM +, Bart Van Assche wrote: Moving these tests into the nvme directory is possible but

[PATCH v8 7/8] block: Make blk_get_request() block for non-PM requests while suspended

2018-09-18 Thread Bart Van Assche
blk_get_request() callers are waiting. For blk-mq, instead of maintaining the q->nr_pending counter, rely on q->q_usage_counter. Call pm_runtime_mark_last_busy() every time a request finishes instead of only if the queue depth drops to zero. Signed-off-by: Bart Van Assche Cc: Christoph H

[PATCH v8 8/8] blk-mq: Enable support for runtime power management

2018-09-18 Thread Bart Van Assche
Now that the blk-mq core processes power management requests (marked with RQF_PREEMPT) in other states than RPM_ACTIVE, enable runtime power management for blk-mq. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn

[PATCH v8 6/8] block: Schedule runtime resume earlier

2018-09-18 Thread Bart Van Assche
patch that will make request allocation block while the queue status is not RPM_ACTIVE. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan Stern --- block/blk-core.c | 2 ++ block/elevator.c | 1 - 2 files

[PATCH v8 3/8] block: Move power management code into a new source file

2018-09-18 Thread Bart Van Assche
layer core code but also reduces the size of header file and hence should help to reduce the build time of the Linux kernel if CONFIG_PM is not defined. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan

[PATCH v8 1/8] blk-mq: Document the functions that iterate over requests

2018-09-18 Thread Bart Van Assche
Make it easier to understand the purpose of the functions that iterate over requests by documenting their purpose. Fix two minor spelling mistakes in comments in these functions. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc

[PATCH v8 5/8] block: Split blk_pm_add_request() and blk_pm_put_request()

2018-09-18 Thread Bart Van Assche
Move the pm_request_resume() and pm_runtime_mark_last_busy() calls into two new functions and thereby separate legacy block layer code from code that works for both the legacy block layer and blk-mq. A later patch will add calls to the new functions in the blk-mq code. Signed-off-by: Bart Van

<    1   2   3   4   5   6   7   8   9   10   >