Re: [PATCH v3] blk-mq: punt failed direct issue to dispatch list

2018-12-07 Thread Bart Van Assche
On Fri, 2018-12-07 at 09:35 -0700, Jens Axboe wrote: > diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c > index 29bfe8017a2d..9e5bda8800f8 100644 > --- a/block/blk-mq-sched.c > +++ b/block/blk-mq-sched.c > @@ -377,6 +377,16 @@ void blk_mq_sched_insert_request(struct request *rq, > bool

Re: [PATCH v3] blk-mq: punt failed direct issue to dispatch list

2018-12-07 Thread Bart Van Assche
On Thu, 2018-12-06 at 22:17 -0700, Jens Axboe wrote: > Instead of making special cases for what we can direct issue, and now > having to deal with DM solving the livelock while still retaining a BUSY > condition feedback loop, always just add a request that has been through > ->queue_rq() to the

Re: [GIT PULL] Follow up block fix

2018-12-06 Thread Bart Van Assche
On Thu, 2018-12-06 at 17:26 -0700, Jens Axboe wrote: > On 12/6/18 5:20 PM, Bart Van Assche wrote: > > Which branch does that tag correspond to? Even after having run git fetch > > --tags I can't find that tag in your repository. > > I pushed it before I sent the email,

Re: [GIT PULL] Follow up block fix

2018-12-06 Thread Bart Van Assche
On Thu, 2018-12-06 at 16:59 -0700, Jens Axboe wrote: > Just a single followup fix to the corruption fix from yesterday. We have > an exported interface that does direct dispatch, with DM being the sole > user of it. Change that to do bypass insert always instead of attempting > direct dispatch.

Re: [PATCH] block: fix direct dispatch issue failure for clones

2018-12-06 Thread Bart Van Assche
corruption with direct issue") > > Signed-off-by: Jens Axboe > > Bart, I'll add your reported-by here of course, and also a stable CC > since the original patch went into stable. Feel free to add the following: Tested-by: Bart Van Assche

Re: for-next branch and blktests/srp

2018-12-06 Thread Bart Van Assche
On Thu, 2018-12-06 at 08:47 -0800, Bart Van Assche wrote: > If I merge Jens' for-next branch with Linus' master branch, boot the > resulting kernel in a VM and run blktests/tests/srp/002 then that test > never finishes. The same test passes against Linus' master branch.

Re: for-next branch and blktests/srp

2018-12-06 Thread Bart Van Assche
On Thu, 2018-12-06 at 11:12 -0700, Jens Axboe wrote: > On 12/6/18 11:10 AM, Bart Van Assche wrote: > > On Thu, 2018-12-06 at 10:02 -0800, Bart Van Assche wrote: > > > On Thu, 2018-12-06 at 10:48 -0700, Jens Axboe wrote: > > > > which would result in a non-zero

Re: for-next branch and blktests/srp

2018-12-06 Thread Bart Van Assche
On Thu, 2018-12-06 at 10:02 -0800, Bart Van Assche wrote: > On Thu, 2018-12-06 at 10:48 -0700, Jens Axboe wrote: > > which would result in a non-zero exit, which should be expected for this > > test? > > Test srp/002 simulates network failures while running fio on top

Re: for-next branch and blktests/srp

2018-12-06 Thread Bart Van Assche
On Thu, 2018-12-06 at 10:48 -0700, Jens Axboe wrote: > which would result in a non-zero exit, which should be expected for this > test? Hi Jens, Test srp/002 simulates network failures while running fio on top of dm-mpath. Since queue_if_no_path is enabled in multipath.conf dm-mpath will keep

Re: for-next branch and blktests/srp

2018-12-06 Thread Bart Van Assche
On Thu, 2018-12-06 at 10:00 -0700, Jens Axboe wrote: > On 12/6/18 9:47 AM, Bart Van Assche wrote: > > If I merge Jens' for-next branch with Linus' master branch, boot the > > resulting kernel in a VM and run blktests/tests/srp/002 then that test > > never finishes. The sam

for-next branch and blktests/srp

2018-12-06 Thread Bart Van Assche
Hello, If I merge Jens' for-next branch with Linus' master branch, boot the resulting kernel in a VM and run blktests/tests/srp/002 then that test never finishes. The same test passes against Linus' master branch. I think this is a regression. The following appears in the system log if I run that

for-next branch and throttling

2018-12-06 Thread Bart Van Assche
Hello, If I merge Jens' for-next branch with Linus' master branch and boot the resulting kernel in a VM then the call trace shown below appears. This call trace does not appear when building and booting the code from Linus' master branch. Is this perhaps a regression? WARNING: CPU: 1 PID: 257 at

Re: [PATCH v3] block: add documentation for io_timeout

2018-12-06 Thread Bart Van Assche
On Wed, 2018-12-05 at 22:17 +0800, Weiping Zhang wrote: > +Description: > + io_timeout is a request’s timeouts at block layer in > + milliseconds. When the underlying driver starts processing > + a request, the generic block layer will start a timer, if > +

Re: [PATCH 1/2] block: get rid of BLK_MAX_TIMEOUT

2018-12-06 Thread Bart Van Assche
On Thu, 2018-12-06 at 22:18 +0800, Weiping Zhang wrote: > Before this patch, even we set io_timeout to 30*HZ(default), but > blk_rq_timeout always return jiffies +5*HZ, > [1]. if there no pending request in timeout list, the timer callback > blk_rq_timed_out_timer will be called after 5*HZ, and

Re: [PATCH v3] block: add documentation for io_timeout

2018-12-06 Thread Bart Van Assche
On Wed, 2018-12-05 at 22:59 +0800, Weiping Zhang wrote: > Weiping Zhang 于2018年12月5日周三 下午10:49写道: > > Christoph Hellwig 于2018年12月5日周三 下午10:40写道: > > > Can you please also send a patch to not show this attribute for > > > drivers without a timeout handler? Thanks! > > Is there a simple way do

Re: [PATCH 1/2] block: get rid of BLK_MAX_TIMEOUT

2018-12-05 Thread Bart Van Assche
On Wed, 2018-12-05 at 23:37 +0800, Weiping Zhang wrote: > @@ -130,7 +119,7 @@ void blk_add_timer(struct request *req) >* than an existing one, modify the timer. Round up to next nearest >* second. >*/ > - expiry = blk_rq_timeout(round_jiffies_up(expiry)); > + expiry

Re: [PATCH] blk-mq: Set request mapping to NULL in blk_mq_put_driver_tag

2018-12-04 Thread Bart Van Assche
On 12/4/18 2:00 AM, Kashyap Desai wrote: Problem statement : Whenever try to get outstanding request via scsi_host_find_tag, block layer will return stale entries instead of actual outstanding request. Kernel panic if stale entry is inaccessible or memory is reused. Fix : Undo request mapping in

Re: block: sbitmap related lockdep warning

2018-12-03 Thread Bart Van Assche
On Mon, 2018-12-03 at 15:24 -0700, Jens Axboe wrote: > On 12/3/18 3:02 AM, Ming Lei wrote: > > Hi, > > > > Just found there is sbmitmap related lockdep warning, not take a close > > look yet, maybe > > it is caused by recent sbitmap change. > > > > [1] test > > - modprobe null_blk queue_mode=2

Re: [PATCH 1/2] blk-mq: Export iterating all tagged requests

2018-12-01 Thread Bart Van Assche
On 12/1/18 9:11 AM, Hannes Reinecke wrote: On 12/1/18 5:48 PM, Christoph Hellwig wrote: On Fri, Nov 30, 2018 at 01:36:09PM -0700, Jens Axboe wrote: On 11/30/18 1:26 PM, Keith Busch wrote: A driver may wish to iterate every tagged request, not just ones that satisfy blk_mq_request_started().

Re: [PATCH] block: fix single range discard merge

2018-11-30 Thread Bart Van Assche
On Fri, 2018-11-30 at 10:20 -0700, Jens Axboe wrote: > On 11/30/18 10:18 AM, Bart Van Assche wrote: > > On Sat, 2018-12-01 at 00:38 +0800, Ming Lei wrote: > > > Fixes: 445251d0f4d329a ("blk-mq: fix discard merge with scheduler > > > attached") > >

Re: [PATCH 01/27] aio: fix failure to put the file pointer

2018-11-30 Thread Bart Van Assche
On Fri, 2018-11-30 at 10:08 -0700, Jens Axboe wrote: > On 11/30/18 10:07 AM, Bart Van Assche wrote: > > On Fri, 2018-11-30 at 09:56 -0700, Jens Axboe wrote: > > > If the ioprio capability check fails, we return without putting > > > the file pointer. > > > >

Re: [PATCH] block: fix single range discard merge

2018-11-30 Thread Bart Van Assche
On Sat, 2018-12-01 at 00:38 +0800, Ming Lei wrote: > Fixes: 445251d0f4d329a ("blk-mq: fix discard merge with scheduler attached") Since this patch fixes a bug introduced in kernel v4.16, does it need a "Cc: stable" tag? Thanks, Bart.

Re: [PATCH 05/27] block: ensure that async polled IO is marked REQ_NOWAIT

2018-11-30 Thread Bart Van Assche
On Fri, 2018-11-30 at 09:56 -0700, Jens Axboe wrote: > We can't wait for polled events to complete, as they may require active > polling from whoever submitted it. If that is the same task that is > submitting new IO, we could deadlock waiting for IO to complete that > this task is supposed to be

Re: [PATCH 01/27] aio: fix failure to put the file pointer

2018-11-30 Thread Bart Van Assche
On Fri, 2018-11-30 at 09:56 -0700, Jens Axboe wrote: > If the ioprio capability check fails, we return without putting > the file pointer. > > Fixes: d9a08a9e616b ("fs: Add aio iopriority support") > Reviewed-by: Johannes Thumshirn > Reviewed-by: Christoph Hellwig > Signed-off-by: Jens Axboe >

Re: [PATCH v2] block: add documentation for io_timeout

2018-11-29 Thread Bart Van Assche
On Thu, 2018-11-29 at 18:22 +0800, Weiping Zhang wrote: > add documentation for /sys/block//queue/io_timeout Patch descriptions should consist of full sentences. That means that these should start with a capital letter and end with a period. > + > +What:

Re: [PATCH] block: add documentation for io_timeout

2018-11-28 Thread Bart Van Assche
On Thu, 2018-11-29 at 00:54 +0800, Weiping Zhang wrote: > add documentation for /sys/block//queue/io_timeout > > Signed-off-by: Weiping Zhang > --- > Documentation/ABI/testing/sysfs-block | 9 + > Documentation/block/queue-sysfs.txt | 6 ++ > 2 files changed, 15 insertions(+) > >

Re: [RFC PATCH v2] block: add io timeout to sysfs

2018-11-28 Thread Bart Van Assche
On Mon, 2018-11-19 at 22:11 +0800, Weiping Zhang wrote: > Give a interface to adjust io timeout by device. > > Signed-off-by: Weiping Zhang > --- > > Changes since v1: > * make sure timeout > 0 > > block/blk-sysfs.c | 27 +++ > 1 file changed, 27 insertions(+)

Re: [PATCH] kyber: fix wrong strlcpy() size in trace_kyber_latency()

2018-11-11 Thread Bart Van Assche
On 11/11/18 9:25 AM, Omar Sandoval wrote: From: Omar Sandoval When copying to the latency type, we should be passing LATENCY_TYPE_LEN, not DOMAIN_LEN. This isn't a problem in practice because we only pass "total" or "I/O", but let's fix it. Reported-by: Jordan Glover Signed-off-by: Omar

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

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 @@ stru

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

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

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: > > > > R

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 this cas

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

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

2018-10-18 Thread Bart Van Assche
rceptible ^ ^^^ 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

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 > + * -

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

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
nly" 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

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

2018-09-26 Thread Bart Van Assche
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 percpu-refcoun

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

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

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 >

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

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
nly" 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 index

[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
nt 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, scsi: Change t

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

[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 4/8] block, scsi: Change the preempt-only flag into a counter

2018-09-19 Thread Bart Van Assche
nly" 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 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
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-only fla

[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

[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

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

2018-09-18 Thread Bart Van Assche
nly" 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 v8 2/8] blk-mq: Introduce blk_mq_queue_rq_iter()

2018-09-18 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-

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

2018-09-18 Thread Bart Van Assche
hao's feedback including 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 (6): block: Move power management code into a new sourc

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

2018-09-18 Thread Bart Van Assche
On 9/17/18 7:39 PM, jianchao.wang wrote: On 09/18/2018 04:15 AM, Bart Van Assche wrote: Instead of allowing requests that are not power management requests to enter the queue in runtime suspended status (RPM_SUSPENDED), make the blk_get_request() caller block. This change fixes a starvation

Re: [PATCH v7 0/6] blk-mq: Implement runtime power management

2018-09-17 Thread Bart Van Assche
On 9/17/18 1:11 PM, Bart Van Assche wrote: [ ... ] Please ignore this e-mail thread - it contains a mixup of two versions of this patch series. Bart.

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

2018-09-17 Thread Bart Van Assche
blk_get_request() callers are waiting. 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 Hellwig Cc: Mi

[PATCH v7 4/6] block: Schedule runtime resume earlier

2018-09-17 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

  1   2   3   4   5   6   7   8   9   10   >