Re: [for-4.16 PATCH v3 2/3] block: allow gendisk's request_queue registration to be deferred

2018-01-11 Thread Bart Van Assche
On Thu, 2018-01-11 at 14:20 -0500, Mike Snitzer wrote: > Yes, I noticed the use of sysfs_lock also. I've fixed it up earlier in > my v4 patchset and build on it. I'll add your Reported-by too. Hello Mike, There are many more inconsistencies with regard to queue flag manipulation in the block

Re: [for-4.16 PATCH v3 2/3] block: allow gendisk's request_queue registration to be deferred

2018-01-11 Thread Bart Van Assche
On Thu, 2018-01-11 at 12:29 -0500, Mike Snitzer wrote: > On Thu, Jan 11 2018 at 12:18pm -0500, > Bart Van Assche <bart.vanass...@wdc.com> wrote: > > > On Thu, 2018-01-11 at 12:04 -0500, Mike Snitzer wrote: > > > So my v4, that I'll send out shortly, won

Re: [PATCH v2 2/2] blk-mq: Fix a race condition in blk_mq_mark_tag_wait()

2018-01-11 Thread Bart Van Assche
On Thu, 2018-01-11 at 08:39 +0100, Hannes Reinecke wrote: > I'm actually not that convinced with this change; originally we had been > checking if it's on the wait list, and only _then_ call bt_wait_ptr(). > Now we call bt_wait_ptr() always, meaning we run a chance of increasing > the bitmap_tags

Re: [for-4.16 PATCH v3 2/3] block: allow gendisk's request_queue registration to be deferred

2018-01-11 Thread Bart Van Assche
On Thu, 2018-01-11 at 12:04 -0500, Mike Snitzer wrote: > So my v4, that I'll send out shortly, won't be using test_and_clear_bit() Please use queue_flag_set(), queue_flag_clear(), queue_flag_test_and_clear() and/or queue_flag_test_and_set() to manipulate queue flags. Thanks, Bart.

Re: scsi: memory leak in sg_start_req

2018-01-11 Thread Bart Van Assche
On Thu, 2018-01-11 at 01:04 -0500, Douglas Gilbert wrote: > Monitoring that program with 'free' from another terminal I see > about 2.5 GBytes of ram "swallowed" almost immediately when the test > program runs. When the program exits (about 50 seconds later) as far > as I can see all that ram is

[PATCH v3 0/2] Rework blk_mq_mark_tag_wait()

2018-01-10 Thread Bart Van Assche
of if (...) ... else ... as proposed by Jens. Changes compared to v1: - Split a single patch into two patches to make reviewing easier. - The race fix does no longer use prepare_to_wait() / finish_wait(). Bart Van Assche (2): blk-mq: Reduce the number of if-statements in blk_mq_mark_tag_wait() blk-mq

[PATCH v3 1/2] blk-mq: Reduce the number of if-statements in blk_mq_mark_tag_wait()

2018-01-10 Thread Bart Van Assche
This patch does not change any functionality but makes the blk_mq_mark_tag_wait() code slightly easier to read. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Omar Sandoval <osan...@fb.com> Cc: Hannes Reinecke <h...@suse.de>

[PATCH v3 2/2] blk-mq: Fix a race condition in blk_mq_mark_tag_wait()

2018-01-10 Thread Bart Van Assche
Both add_wait_queue() and blk_mq_dispatch_wake() protect wait queue manipulations with the wait queue lock. Hence also protect the !list_empty(>entry) test with the wait queue lock. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Omar

Re: [PATCH v2 1/2] blk-mq: Reduce the number of if-statements in blk_mq_mark_tag_wait()

2018-01-10 Thread Bart Van Assche
On Wed, 2018-01-10 at 13:30 -0700, Jens Axboe wrote: > On 1/10/18 12:39 PM, Bart Van Assche wrote: > > This patch does not change any functionality but makes the > > blk_mq_mark_tag_wait() code slightly easier to read. > > I agree it could do with a cleanup, but how

[PATCH v2 0/2] Rework blk_mq_mark_tag_wait()

2018-01-10 Thread Bart Van Assche
. - The race fix does no longer use prepare_to_wait() / finish_wait(). Bart Van Assche (2): blk-mq: Reduce the number of if-statements in blk_mq_mark_tag_wait() blk-mq: Fix a race condition in blk_mq_mark_tag_wait() block/blk-mq.c | 49 - 1 file changed

[PATCH v2 1/2] blk-mq: Reduce the number of if-statements in blk_mq_mark_tag_wait()

2018-01-10 Thread Bart Van Assche
This patch does not change any functionality but makes the blk_mq_mark_tag_wait() code slightly easier to read. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Omar Sandoval <osan...@fb.com> Cc: Hannes Reinecke <h...@suse.de>

[PATCH v2 2/2] blk-mq: Fix a race condition in blk_mq_mark_tag_wait()

2018-01-10 Thread Bart Van Assche
Both add_wait_queue() and blk_mq_dispatch_wake() protect wait queue manipulations with the wait queue lock. Hence also protect the !list_empty(>entry) test with the wait queue lock instead of the hctx lock. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <

[PATCH] blk-mq: Add locking annotations to hctx_lock() and hctx_unlock()

2018-01-10 Thread Bart Van Assche
This patch avoids that sparse reports the following: block/blk-mq.c:637:33: warning: context imbalance in 'hctx_unlock' - unexpected unlock block/blk-mq.c:642:9: warning: context imbalance in 'hctx_lock' - wrong count at exit Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc:

Re: [PATCH 3/4] block: convert REQ_ATOM_COMPLETE to stealing rq->__deadline bit

2018-01-10 Thread Bart Van Assche
On Wed, 2018-01-10 at 11:35 -0700, Jens Axboe wrote: > On 1/10/18 11:33 AM, Bart Van Assche wrote: > > On Wed, 2018-01-10 at 11:32 -0700, Jens Axboe wrote: > > > On 1/10/18 11:29 AM, Bart Van Assche wrote: > > > > On Tue, 2018-01-09 at 17:29 -0700, Jens Axboe wro

Re: [PATCH 4/4] block: rearrange a few request fields for better cache layout

2018-01-10 Thread Bart Van Assche
; queueing related bits in the first cache line. > > This yields a 1.5-2% increase in IOPS for a null_blk test, both for > sync and for high thread count access. Sync test goes form 975K to > 992K, 32-thread case from 20.8M to 21.2M IOPS. That's a nice result! Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH 3/4] block: convert REQ_ATOM_COMPLETE to stealing rq->__deadline bit

2018-01-10 Thread Bart Van Assche
On Wed, 2018-01-10 at 11:32 -0700, Jens Axboe wrote: > On 1/10/18 11:29 AM, Bart Van Assche wrote: > > On Tue, 2018-01-09 at 17:29 -0700, Jens Axboe wrote: > > > @@ -313,8 +307,6 @@ int __blk_mq_debugfs_rq_show(struct seq_file *m, > > > struct request *rq) >

Re: [PATCH 3/4] block: convert REQ_ATOM_COMPLETE to stealing rq->__deadline bit

2018-01-10 Thread Bart Van Assche
On Tue, 2018-01-09 at 17:29 -0700, Jens Axboe wrote: > @@ -313,8 +307,6 @@ int __blk_mq_debugfs_rq_show(struct seq_file *m, struct > request *rq) > seq_puts(m, ", .rq_flags="); > blk_flags_show(m, (__force unsigned int)rq->rq_flags, rqf_name, >

Re: [PATCH 2/4] block: add accessors for setting/querying request deadline

2018-01-10 Thread Bart Van Assche
wed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH 1/4] block: remove REQ_ATOM_POLL_SLEPT

2018-01-10 Thread Bart Van Assche
ee the right state. Please consider updating rqf_name[] in blk-mq-debugfs.c. Anyway: Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

[PATCH v2 2/4] block: Introduce blk_start_wait_if_quiesced() and blk_finish_wait_if_quiesced()

2018-01-10 Thread Bart Van Assche
Introduce functions that allow block drivers to wait while a request queue is in the quiesced state (blk-mq) or in the stopped state (legacy block layer). The next patch will add calls to these functions in the SCSI core. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Ma

[PATCH v2 3/4] scsi: Avoid that .queuecommand() gets called for a quiesced SCSI device

2018-01-10 Thread Bart Van Assche
in scsi_send_eh_cmnd() into code that calls blk_get_request(), e.g. scsi_execute_req(), is not an option since scsi_send_eh_cmnd() can be called if all requests are allocated and if no requests will make progress without aborting any of these requests. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.

[PATCH v2 0/4] Make SCSI transport recovery more robust

2018-01-10 Thread Bart Van Assche
in the comment above blk_start_wait_if_quiesced() that every call of this function has to be followed by a call of blk_finish_wait_if_quiesced(). Bart Van Assche (4): blk-mq: Rename request_queue.mq_freeze_wq into mq_wq block: Introduce blk_start_wait_if_quiesced() and blk_finish_wait_if_quiesced

[PATCH v2 4/4] IB/srp: Fix a sleep-in-invalid-context bug

2018-01-10 Thread Bart Van Assche
si_run_queue+0x18e/0x2d0 scsi_run_host_queues+0x22/0x40 scsi_error_handler+0x18d/0x5f0 kthread+0x11c/0x140 ret_from_fork+0x24/0x30 Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Reviewed-by: Hannes Reinecke <h...@suse.com> Cc: Jason Gunthorpe <j...@mellanox.com> Cc: Dou

[PATCH v2 1/4] blk-mq: Rename request_queue.mq_freeze_wq into mq_wq

2018-01-10 Thread Bart Van Assche
Rename a waitqueue in struct request_queue since the next patch will add code that uses this waitqueue outside the request queue freezing implementation. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Reviewed-by: Hannes Reinecke <h...@suse.de> Cc: Christoph Hellwig <

[PATCH] blk-mq: Explain when 'active_queues' is decremented

2018-01-10 Thread Bart Van Assche
It is nontrivial to derive from the blk-mq source code when blk_mq_tags.active_queues is decremented. Hence add a comment that explains this. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc:

Re: [PATCH] bdi: show error log when fail to create bdi debugfs entry

2018-01-10 Thread Bart Van Assche
On Wed, 2018-01-10 at 23:18 +0800, weiping zhang wrote: > bdi debugfs dir/file may create fail, add error log here. > > Signed-off-by: weiping zhang > --- > mm/backing-dev.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git

Re: [PATCH 2/4] block: Introduce blk_wait_if_quiesced() and blk_finish_wait_if_quiesced()

2018-01-09 Thread Bart Van Assche
On Tue, 2018-01-09 at 07:41 +0100, Hannes Reinecke wrote: > I'm always a bit cautious when having rcu_read_lock() and > rcu_read_unlock() in two separate functions. > Can we make this dependency more explicit by renaming the first function > to blk_start_wait_if_quiesced() and updating the comment

Re: [for-4.16 PATCH 1/2] block: cope with gendisk's 'queue' being added later

2018-01-09 Thread Bart Van Assche
On Tue, 2018-01-09 at 17:10 -0500, Mike Snitzer wrote: > diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c > index 870484eaed1f..0b0dda8e2420 100644 > --- a/block/blk-sysfs.c > +++ b/block/blk-sysfs.c > @@ -919,8 +919,20 @@ int blk_register_queue(struct gendisk *disk) > ret = 0; > unlock:

[PATCH] block: Fix kernel-doc warnings reported when building with W=1

2018-01-09 Thread Bart Van Assche
y with W=1. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Martin K. Petersen <martin.peter...@oracle.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc: Johannes Thumshirn <jthumsh...@suse.de> --- block/bsg-lib.c| 3 ++- block

[PATCH, resend] blk-mq: Fix spelling in a source code comment

2018-01-09 Thread Bart Van Assche
Change "nedeing" into "needing" and "caes" into "cases". Fixes: commit f906a6a0f426 ("blk-mq: improve tag waiting setup for non-shared tags") Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de

Re: [PATCH 2/8] blk-mq: protect completion path with RCU

2018-01-09 Thread Bart Van Assche
On Mon, 2018-01-08 at 11:15 -0800, Tejun Heo wrote: > Currently, blk-mq protects only the issue path with RCU. This patch > puts the completion path under the same RCU protection. This will be > used to synchronize issue/completion against timeout by later patches, > which will also add the

Re: [linux-next][qla2xxx][85caa95]kernel BUG at lib/list_debug.c:31!

2018-01-09 Thread Bart Van Assche
On Tue, 2018-01-09 at 14:44 +0530, Abdul Haleem wrote: > Greeting's, > > Linux next kernel panics on powerpc when module qla2xxx is load/unload. > > Machine Type: Power 8 PowerVM LPAR > Kernel : 4.15.0-rc2-next-20171211 > gcc : version 4.8.5 > Test type: module load/unload few times > > Trace

Re: [PATCH 8/8] blk-mq: rename blk_mq_hw_ctx->queue_rq_srcu to ->srcu

2018-01-08 Thread Bart Van Assche
On Mon, 2018-01-08 at 11:15 -0800, Tejun Heo wrote: > The RCU protection has been expanded to cover both queueing and > completion paths making ->queue_rq_srcu a misnomer. Rename it to > ->srcu as suggested by Bart. Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH 7/8] blk-mq: remove REQ_ATOM_STARTED

2018-01-08 Thread Bart Van Assche
Add MQ_RQ_COMPLETE and replace REQ_ATOM_STARTED usages with > blk_mq_rq_state() tests. REQ_ATOM_STARTED no longer has any users > left and is removed. Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH 6/8] blk-mq: remove REQ_ATOM_COMPLETE usages from blk-mq

2018-01-08 Thread Bart Van Assche
On Mon, 2018-01-08 at 11:15 -0800, Tejun Heo wrote: > After the recent updates to use generation number and state based > synchronization, blk-mq no longer depends on REQ_ATOM_COMPLETE except > to avoid firing the same timeout multiple times. > > Remove all REQ_ATOM_COMPLETE usages and use a new

Re: [PATCH 3/8] blk-mq: replace timeout synchronization with a RCU and generation based scheme

2018-01-08 Thread Bart Van Assche
On Mon, 2018-01-08 at 11:15 -0800, Tejun Heo wrote: > @@ -230,6 +232,27 @@ struct request { > > unsigned short write_hint; > > + /* > + * On blk-mq, the lower bits of ->gstate carry the MQ_RQ_* state > + * value and the upper bits the generation number which is > + *

Re: [PATCH 5/8] blk-mq: make blk_abort_request() trigger timeout path

2018-01-08 Thread Bart Van Assche
On Mon, 2018-01-08 at 11:15 -0800, Tejun Heo wrote: > @@ -156,12 +156,12 @@ void blk_timeout_work(struct work_struct *work) > */ > void blk_abort_request(struct request *req) > { > - if (blk_mark_rq_complete(req)) > - return; > - > if (req->q->mq_ops) { > -

Re: [PATCH 4/8] blk-mq: use blk_mq_rq_state() instead of testing REQ_ATOM_COMPLETE

2018-01-08 Thread Bart Van Assche
ce the tests. This will allow removing > REQ_ATOM_COMPLETE usages from blk-mq. Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH 3/8] blk-mq: replace timeout synchronization with a RCU and generation based scheme

2018-01-08 Thread Bart Van Assche
On Mon, 2018-01-08 at 11:15 -0800, Tejun Heo wrote: > +static void blk_mq_rq_update_aborted_gstate(struct request *rq, u64 gstate) > +{ > + unsigned long flags; > + > + local_irq_save(flags); > + u64_stats_update_begin(>aborted_gstate_sync); > + rq->aborted_gstate = gstate; > +

Re: [PATCH 1/8] blk-mq: move hctx lock/unlock into a helper

2018-01-08 Thread Bart Van Assche
A minor comment: please consider to reorder these two functions such that the lock function appears first and the unlock function second. Anyway: Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

[PATCH 4/4] IB/srp: Fix a sleep-in-invalid-context bug

2018-01-08 Thread Bart Van Assche
si_run_queue+0x18e/0x2d0 scsi_run_host_queues+0x22/0x40 scsi_error_handler+0x18d/0x5f0 kthread+0x11c/0x140 ret_from_fork+0x24/0x30 Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Jason Gunthorpe <j...@mellanox.com> Cc: Doug Ledford <dledf...@redhat.com> --- drivers/in

[PATCH 1/4] blk-mq: Rename request_queue.mq_freeze_wq into mq_wq

2018-01-08 Thread Bart Van Assche
Rename a waitqueue in struct request_queue since the next patch will add code that uses this waitqueue outside the request queue freezing implementation. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.d

[PATCH 3/4] scsi: Avoid that .queuecommand() gets called for a quiesced SCSI device

2018-01-08 Thread Bart Van Assche
() into code that calls blk_get_request(), e.g. scsi_execute_req(), is not an option since scsi_send_eh_cmnd() can be called if all requests are allocated and if no requests will make progress without aborting any of these requests. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Ma

[PATCH 0/4] Make SCSI transport recovery more robust

2018-01-08 Thread Bart Van Assche
. Please consider this patch series for kernel v4.16. Thanks, Bart. Bart Van Assche (4): blk-mq: Rename request_queue.mq_freeze_wq into mq_wq block: Introduce blk_wait_if_quiesced() and blk_finish_wait_if_quiesced() scsi: Avoid that .queuecommand() gets called for a quiesced SCSI

[PATCH] block: Fix kernel-doc warnings reported when building with W=1

2018-01-08 Thread Bart Van Assche
y with W=1. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Martin K. Petersen <martin.peter...@oracle.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc: Johannes Thumshirn <jthumsh...@suse.de> --- block/bsg-lib.c| 3 ++- block

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

2018-01-05 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> Acked-by: Ard Biesheuvel <ard.biesheu...@linaro.org> Cc: Herbert Xu <herb...@gondor.apana.org.au> --- crypto/Kconfig | 1 + crypt

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

2018-01-05 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> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> Reviewed-by: Hannes Reinecke <h...@suse.com> Cc: Keith Busch <keith.bu...@int

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

2018-01-05 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> Acked-by: Nicholas A. Bellinger <n...@linux-iscsi.org> Reviewed-by: Hannes Reinecke <h...@suse.com> Cc: Christoph Hellwig <

[PATCH v4 1/5] lib/scatterlist: Introduce sgl_alloc() and sgl_free()

2018-01-05 Thread Bart Van Assche
if CONFIG_SGL_ALLOC=y to avoid that the kernel size increases if this functionality is not used. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Reviewed-by: Hannes Reinecke <h...@suse.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> --- include/linux/scatterlist.

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

2018-01-05 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> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> Reviewed-by: Hannes Reinecke <h...@suse.com> Cc: Keith Busch <keith.bu...@int

[PATCH v4 0/5] Introduce sgl_alloc() and sgl_free()

2018-01-05 Thread Bart Van Assche
for the entire patch series. Changes between v1 and v2: - Moved the sgl_alloc*() and sgl_free() functions from a new source file into lib/scatterlist.c. - Changed the argument order for the sgl_alloc*() functions such that the (pointer to) the output argument comes last. Bart Van Assche (5): lib

Re: 4.15-rcX 32-bit SCSI suspend2ram warning

2018-01-03 Thread Bart Van Assche
On Wed, 2018-01-03 at 12:16 -0500, Woody Suwalski wrote: > Starting with a 32-bit 4.15-rcX I have observed a warning in dmesg, > happening when the system goes to suspend2ram. If it is just a warning > - could we have it quiet'et down? (+linux-scsi) Thank you for having reported this. The

[PATCH 2/2] pktcdvd: Fix a recently introduced NULL pointer dereference

2018-01-02 Thread Bart Van Assche
o.name> Fixes: commit ca18d6f769d2 ("block: Make most scsi_req_init() calls implicit") Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Tested-by: Maciej S. Szmigiero <m...@maciej.szmigiero.name> Cc: Maciej S. Szmigiero <m...@maciej.szmigiero.name> Cc: <sta.

[PATCH 1/2] pktcdvd: Fix pkt_setup_dev() error path

2018-01-02 Thread Bart Van Assche
ck: make gendisk hold a reference to its queue") Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Tejun Heo <t...@kernel.org> Cc: Maciej S. Szmigiero <m...@maciej.szmigiero.name> Cc: <sta...@vger.kernel.org> # v3.2 --- drivers/block/pktcdvd.c | 4 +--- 1 file c

[PATCH 0/2] Two bug fixes for the pktcdvd driver

2018-01-02 Thread Bart Van Assche
Hello Jens, This patch series fixes two bugs in the pktcdvd driver. The second patch fixes a recently introduced regression while the first patch fixes a regression that was introduced a long time ago. Please consider these patches for the upstream kernel. Thanks, Bart. Bart Van Assche (2

Re: [v2,4/6] pktcdvd: Check queue type before attaching to a queue

2017-12-30 Thread Bart Van Assche
, > which is supposed to return bdev->bd_disk->queue, but in this case > bdev->bd_disk is NULL. Would it be possible to test the two attached patches? Thanks, Bart.From 8ef0308718a3f3f60c0c6983d3ff606ac8d3db8d Mon Sep 17 00:00:00 2001 From: Bart Van Assche <bart.vanass...@wdc.com

Re: regression 4.15-rc: kernel oops in dm-multipath

2017-12-22 Thread Bart Van Assche
On Fri, 2017-12-22 at 10:53 +0100, Christian Borntraeger wrote: > any quick ideas? Hello Christian, Was commit afc567a4977b ("dm table: fix regression from improper dm_dev_internal.count refcount_t conversion") included in your test kernel? Bart.

Re: [PATCHSET v2] blk-mq: reimplement timeout handling

2017-12-20 Thread Bart Van Assche
On Wed, 2017-12-20 at 16:08 -0800, t...@kernel.org wrote: > On Wed, Dec 20, 2017 at 11:41:02PM +0000, Bart Van Assche wrote: > > On Tue, 2017-12-12 at 11:01 -0800, Tejun Heo wrote: > > > Currently, blk-mq timeout path synchronizes against the usual > > > issue/comp

Re: [PATCHSET v2] blk-mq: reimplement timeout handling

2017-12-20 Thread Bart Van Assche
On Tue, 2017-12-12 at 11:01 -0800, Tejun Heo wrote: > Currently, blk-mq timeout path synchronizes against the usual > issue/completion path using a complex scheme involving atomic > bitflags, REQ_ATOM_*, memory barriers and subtle memory coherence > rules. Unfortunatley, it contains quite a few

Re: [PATCH V2 0/2] block: fix queue freeze and cleanup

2017-12-15 Thread Bart Van Assche
On Fri, 2017-12-15 at 15:58 +0800, chenxiang (M) wrote: > I tested v2 of this series based on Martin's for-4.16 SCSI tree which > branch error handler issue "scsi: core: Ensure that the > SCSI error handler gets woken up" is merged. And system is still hung > after repeat my testcase. Hello

Re: [PATCH 2/6] blk-mq: replace timeout synchronization with a RCU and generation based scheme

2017-12-14 Thread Bart Van Assche
On Thu, 2017-12-14 at 21:20 +0100, Peter Zijlstra wrote: > On Thu, Dec 14, 2017 at 06:51:11PM +0000, Bart Van Assche wrote: > > On Tue, 2017-12-12 at 11:01 -0800, Tejun Heo wrote: > > > + write_seqcount_begin(>gstate_seq); > > > + blk_mq_rq_update_state(rq, MQ_RQ_IN_

Re: [PATCH 2/6] blk-mq: replace timeout synchronization with a RCU and generation based scheme

2017-12-14 Thread Bart Van Assche
On Thu, 2017-12-14 at 11:19 -0800, t...@kernel.org wrote: > On Thu, Dec 14, 2017 at 06:51:11PM +0000, Bart Van Assche wrote: > > On Tue, 2017-12-12 at 11:01 -0800, Tejun Heo wrote: > > > --- a/block/blk-core.c > > > +++ b/block/blk-core.c > > > @@ -126

Re: [PATCH 2/6] blk-mq: replace timeout synchronization with a RCU and generation based scheme

2017-12-14 Thread Bart Van Assche
On Tue, 2017-12-12 at 11:01 -0800, Tejun Heo wrote: > rules. Unfortunatley, it contains quite a few holes. ^ Unfortunately? > While this change makes REQ_ATOM_COMPLETE synchornization unnecessary ^^^

Re: [PATCH 1/6] blk-mq: protect completion path with RCU

2017-12-14 Thread Bart Van Assche
On Tue, 2017-12-12 at 11:01 -0800, Tejun Heo wrote: > + } else { > + srcu_idx = srcu_read_lock(hctx->queue_rq_srcu); > + if (!blk_mark_rq_complete(rq)) > + __blk_mq_complete_request(rq); > + srcu_read_unlock(hctx->queue_rq_srcu,

Re: [PATCH V2 0/2] block: fix queue freeze and cleanup

2017-12-13 Thread Bart Van Assche
On Wed, 2017-11-29 at 10:57 +0800, chenxiang (M) wrote: > I applied this v2 patchset to kernel 4.15-rc1, running fio on a SATA > disk, then disable the disk with sysfs interface > (echo 0 > /sys/class/sas_phy/phy-1:0:1/enable), and find system is hung. > But with v1 patch, it doesn't has this

Re: [PATCH V2 0/2] block: fix queue freeze and cleanup

2017-12-13 Thread Bart Van Assche
Hello Mauricio, Would it be possible to repeat your test with the patch below applied on your kernel tree? This patch has just been posted on the dm-devel mailing list. Thanks, Bart. From: Bart Van Assche <bart.vanass...@wdc.com> Date: Wed, 13 Dec 2017 13:07:14 -0800 Subject: [PATCH] dm: Fix

Re: About the try to remove cross-release feature entirely by Ingo

2017-12-13 Thread Bart Van Assche
On Wed, 2017-12-13 at 16:13 +0900, Byungchul Park wrote: > In addition, I want to say that the current level of > classification is much less than 100% but, since we > have annotated well to suppress wrong reports by > rough classifications, finally it does not come into > view by original lockdep

Re: [PATCH 6/6] blk-mq: remove REQ_ATOM_STARTED

2017-12-12 Thread Bart Van Assche
On Tue, 2017-12-12 at 11:01 -0800, Tejun Heo wrote: > @@ -409,7 +407,7 @@ static void hctx_show_busy_rq(struct request *rq, void > *data, bool reserved) > const struct show_busy_params *params = data; > > if (blk_mq_map_queue(rq->q, rq->mq_ctx->cpu) == params->hctx && > -

Re: [PATCH 2/6] blk-mq: replace timeout synchronization with a RCU and generation based scheme

2017-12-12 Thread Bart Van Assche
On Tue, 2017-12-12 at 11:01 -0800, Tejun Heo wrote: > +/* > + * Bits for request->gstate. The lower two bits carry MQ_RQ_* state value > + * and the upper bits the generation number. > + */ > +enum mq_rq_state { > + MQ_RQ_IDLE = 0, > + MQ_RQ_IN_FLIGHT = 1, > + > +

Re: [PATCH] SCSI: run queue if SCSI device queue isn't ready and queue is idle

2017-12-07 Thread Bart Van Assche
On Thu, 2017-12-07 at 09:31 +0800, Ming Lei wrote: > But if you always call blk_mq_sched_mark_restart_hctx() before a new > dispatch, that may affect performance on NVMe which may never trigger > BLK_STS_RESOURCE. Hmm ... only the SCSI core implements .get_budget() and .put_budget() and I

Re: [PATCH] SCSI: run queue if SCSI device queue isn't ready and queue is idle

2017-12-07 Thread Bart Van Assche
On Wed, 2017-12-06 at 00:28 +0800, Ming Lei wrote: > On Tue, Dec 05, 2017 at 04:08:20PM +0000, Bart Van Assche wrote: > > On Tue, 2017-12-05 at 15:52 +0800, Ming Lei wrote: > > > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c > > > index db9556

Re: [PATCH] SCSI: run queue if SCSI device queue isn't ready and queue is idle

2017-12-06 Thread Bart Van Assche
On Wed, 2017-12-06 at 09:52 +0800, Ming Lei wrote: > On Wed, Dec 06, 2017 at 12:28:25AM +0800, Ming Lei wrote: > > On Tue, Dec 05, 2017 at 04:08:20PM +0000, Bart Van Assche wrote: > > > The patch below is not a full solution but resulted in a significant > > &

[PATCH v2 1/3] scsi: Fix a scsi_show_rq() NULL pointer dereference

2017-12-05 Thread Bart Van Assche
entry_SYSCALL_64_fastpath+0x1a/0xa5 Fixes: 0eebd005dd07 ("scsi: Implement blk_mq_ops.show_rq()") Reported-by: Ming Lei <ming@redhat.com> Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: James E.J. Bottomley <j...@linux.vnet.ibm.com> Cc: Martin K. Petersen <marti

[PATCH v2 3/3] scsi-mq-debugfs: Show more information

2017-12-05 Thread Bart Van Assche
TIALIZED, .timeout=90.000, allocated 0.010 s ago} Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: James E.J. Bottomley <j...@linux.vnet.ibm.com> Cc: Martin K. Petersen <martin.peter...@oracle.com> Cc: Ming Lei <ming@redhat.com> Cc: Christoph Hellwig <

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

2017-12-05 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. Fixes: commit 2720bab50258 ("blk-mq-debugfs: Show busy requests") Signed-off-by: Bart Van Assche <bart.vanass..

[PATCH v2 0/3] Show all commands in debugfs

2017-12-05 Thread Bart Van Assche
d a change for the SCSI sd driver. Bart Van Assche (3): scsi: Fix a scsi_show_rq() NULL pointer dereference blk-mq-debugfs: Also show requests that have not yet been started scsi-mq-debugfs: Show more information block/blk-mq-debugfs.c | 2 +- drivers/scsi/scsi_debu

Re: [PATCH 1/2] scsi-mq: Only show the CDB if available

2017-12-05 Thread Bart Van Assche
On Wed, 2017-12-06 at 00:38 +0800, Ming Lei wrote: > On Tue, Dec 05, 2017 at 04:22:33PM +0000, Bart Van Assche wrote: > > On Tue, 2017-12-05 at 13:00 +0800, Ming Lei wrote: > > > No, do not mix two different things in one patch, especially the fix part > > > need

Re: [PATCH] SCSI: run queue if SCSI device queue isn't ready and queue is idle

2017-12-05 Thread Bart Van Assche
On Wed, 2017-12-06 at 00:28 +0800, Ming Lei wrote: > This is still a workaround for RESTART, see my comment before: > > https://marc.info/?l=linux-block=151217500929341=2 A quote from that e-mail: "The theory about using BLK_MQ_S_SCHED_RESTART in current way is that we mark it after

Re: [PATCH 1/2] scsi-mq: Only show the CDB if available

2017-12-05 Thread Bart Van Assche
On Tue, 2017-12-05 at 13:00 +0800, Ming Lei wrote: > No, do not mix two different things in one patch, especially the fix part > need to be backported to stable. > > The fix part should aim at V4.15, and the other part can be a V4.16 > stuff. Does this mean that you do not plan to post a v5 of

Re: [PATCH] SCSI: run queue if SCSI device queue isn't ready and queue is idle

2017-12-05 Thread Bart Van Assche
On Tue, 2017-12-05 at 15:29 +0100, Johannes Thumshirn wrote: > 1) Testing without the patch applied hangs the test forever as it >doesn't get killed after a specific timeout (I think this should be >solved in a common function). Hello Johannes, If a request queue got stuck then the

Re: [PATCH] SCSI: run queue if SCSI device queue isn't ready and queue is idle

2017-12-05 Thread Bart Van Assche
On Tue, 2017-12-05 at 15:52 +0800, Ming Lei wrote: > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c > index db9556662e27..1816dd8259b3 100644 > --- a/drivers/scsi/scsi_lib.c > +++ b/drivers/scsi/scsi_lib.c > @@ -1967,6 +1967,8 @@ static bool scsi_mq_get_budget(struct blk_mq_hw_ctx

Re: [PATCH 1/2] scsi-mq: Only show the CDB if available

2017-12-04 Thread Bart Van Assche
On Tue, 2017-12-05 at 09:15 +0800, Ming Lei wrote: > On Mon, Dec 04, 2017 at 04:38:08PM -0800, Bart Van Assche wrote: > > Since the next patch will make it possible that scsi_show_rq() gets > > called before the CDB pointer is changed into a non-NULL value, > > only show the C

Re: [PATCH] blk-mq: Fix several SCSI request queue lockups

2017-12-04 Thread Bart Van Assche
On Tue, 2017-12-05 at 09:04 +0800, Ming Lei wrote: > Then no reason to revert commit(0df21c86bdbf scsi: implement .get_budget an > .put_budget for blk-mq) for one issue which may never happen in reality since > this reproducer need out-of-tree patch. Sorry but I disagree completely. You seem to

[PATCH 0/2] Show commands stuck in a timeout handler in debugfs

2017-12-04 Thread Bart Van Assche
that commands that got stuck in a block driver timeout handler are also shown in debugfs. Please consider these patches for kernel v4.16. Thanks, Bart. Bart Van Assche (2): scsi-mq: Only show the CDB if available blk-mq-debugfs: Also show requests that have not yet been started block/blk

[PATCH 1/2] scsi-mq: Only show the CDB if available

2017-12-04 Thread Bart Van Assche
Lei. See also Ming Lei, scsi_debugfs: fix crash in scsi_show_rq(), linux-scsi, 7 November 2017 (https://marc.info/?l=linux-block=151006655317188). Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: James E.J. Bottomley <j...@linux.vnet.ibm.com> Cc: Martin K. Petersen &

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

2017-12-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 <bart.vanass...@wdc.com> Cc: Ming Lei <ming@redhat.com> Cc: Christoph Hellwig

Re: [PATCH] blk-mq: Fix several SCSI request queue lockups

2017-12-04 Thread Bart Van Assche
On Tue, 2017-12-05 at 08:20 +0800, Ming Lei wrote: > Also it is a bit odd to see request in hctx->dispatch now, and it can only > happen now when scsi_target_queue_ready() returns false, so I guess you apply > some change on target->can_queue(such as setting it as 1 in srp/ib code > manually)?

Re: [PATCH] blk-mq: Fix several SCSI request queue lockups

2017-12-04 Thread Bart Van Assche
On Tue, 2017-12-05 at 07:01 +0800, Ming Lei wrote: > On Mon, Dec 04, 2017 at 10:48:18PM +0000, Bart Van Assche wrote: > > On Tue, 2017-12-05 at 06:42 +0800, Ming Lei wrote: > > > On Mon, Dec 04, 2017 at 09:30:32AM -0800, Bart Van Assche wrote: > > > > * A sys

Re: [PATCH] SCSI: delay run queue if device is blocked in scsi_dev_queue_ready()

2017-12-04 Thread Bart Van Assche
On Tue, 2017-12-05 at 06:45 +0800, Ming Lei wrote: > On Mon, Dec 04, 2017 at 03:09:20PM +0000, Bart Van Assche wrote: > > On Sun, 2017-12-03 at 00:31 +0800, Ming Lei wrote: > > > Fixes: 0df21c86bdbf ("scsi: implement .get_budget and .put_budget for > > > blk

Re: [PATCH] blk-mq: Fix several SCSI request queue lockups

2017-12-04 Thread Bart Van Assche
On Tue, 2017-12-05 at 06:42 +0800, Ming Lei wrote: > On Mon, Dec 04, 2017 at 09:30:32AM -0800, Bart Van Assche wrote: > > * A systematic lockup for SCSI queues with queue depth 1. The > > following test reproduces that bug systematically: > > - Change the SRP initiator

[PATCH] blk-mq: Fix several SCSI request queue lockups

2017-12-04 Thread Bart Van Assche
mmit. Fixes: commit 0df21c86bdbf ("scsi: implement .get_budget and .put_budget for blk-mq") Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Ming Lei <ming@redhat.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.com> Cc:

Re: [PATCH] SCSI: delay run queue if device is blocked in scsi_dev_queue_ready()

2017-12-04 Thread Bart Van Assche
On Sun, 2017-12-03 at 00:31 +0800, Ming Lei wrote: > Fixes: 0df21c86bdbf ("scsi: implement .get_budget and .put_budget for blk-mq") It might be safer to revert commit 0df21c86bdbf instead of trying to fix all issues introduced by that commit for kernel version v4.15 ... Bart.

Re: [PATCH 4/7] blk-mq: Avoid that request processing stalls when sharing tags

2017-12-01 Thread Bart Van Assche
On Sat, 2017-12-02 at 09:00 +0800, Ming Lei wrote: > On Sat, Dec 02, 2017 at 12:48:51AM +0000, Bart Van Assche wrote: > > Further tests have shown that the lockup I referred to does not occur > > before commit > > b347689ffbca but that it occurs with b347689ffbca. > >

Re: [PATCH 4/7] blk-mq: Avoid that request processing stalls when sharing tags

2017-12-01 Thread Bart Van Assche
On Sat, 2017-12-02 at 08:36 +0800, Ming Lei wrote: > On Fri, Dec 01, 2017 at 07:52:14PM +0000, Bart Van Assche wrote: > > On Fri, 2017-12-01 at 10:58 +0800, Ming Lei wrote: > > > On Thu, Nov 30, 2017 at 04:08:45PM -0800, Bart Van Assche wrote: > > > > blk_mq_dispatch_

Re: [PATCH 4/7] blk-mq: Avoid that request processing stalls when sharing tags

2017-12-01 Thread Bart Van Assche
On Fri, 2017-12-01 at 10:58 +0800, Ming Lei wrote: > On Thu, Nov 30, 2017 at 04:08:45PM -0800, Bart Van Assche wrote: > > blk_mq_sched_mark_restart_hctx() must be called before > > Could you please describe the theory on commit log? Like, why is it > a must? and what is the

Re: [PATCH] blk-mq: improve tag waiting setup for non-shared tags

2017-12-01 Thread Bart Van Assche
On Thu, 2017-11-09 at 16:00 -0700, Jens Axboe wrote: > + spin_lock(_hctx->lock); > + if (!list_empty(>entry)) { > + spin_unlock(_hctx->lock); > + return false; > + } > > - ws = bt_wait_ptr(_hctx->tags->bitmap_tags,

Re: [PATCH 2/7] block: Document more locking requirements

2017-12-01 Thread Bart Van Assche
On Thu, 2017-11-30 at 20:03 -0700, Jens Axboe wrote: > On 11/30/2017 05:08 PM, Bart Van Assche wrote: > > This patch does not change any functionality. > > Unless these actually found real bugs, I think it's pointless. > Add a comment. Hello Jens, As you know lockdep_assert

Re: [PATCH V2 0/2] block: fix queue freeze and cleanup

2017-12-01 Thread Bart Van Assche
On Fri, 2017-12-01 at 13:36 -0200, Mauricio Faria de Oliveira wrote: > On 11/29/2017 12:57 AM, chenxiang (M) wrote: > > I applied this v2 patchset to kernel 4.15-rc1, running fio on a SATA > > disk, then disable the disk with sysfs interface > > (echo 0 > /sys/class/sas_phy/phy-1:0:1/enable), and

[PATCH 7/7] blk-mq: Fix another queue stall

2017-11-30 Thread Bart Van Assche
dering by serializing it against the dispatch_wait queue wakeup. This patch fixes a queue stall I ran into while testing a SCSI initiator driver with the maximum target depth set to one. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Ming Lei <ming@redhat.com> Cc: O

[PATCH 6/7] blk-mq: Rerun hardware queues after having called .put_budget()

2017-11-30 Thread Bart Van Assche
1f460b63d4b3 ("blk-mq: don't restart queue when .get_budget returns BLK_STS_RESOURCE") Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Ming Lei <ming@redhat.com> Cc: Omar Sandoval <osan...@fb.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <

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