[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

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

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

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

[PATCH] block: Rework drivers/cdrom/Makefile

2017-10-30 Thread Bart Van Assche
of from the lower layer to the higher layers. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/block/Kconfig| 12 driv

Re: [PATCH v3] virtio_blk: Fix an SG_IO regression

2017-10-26 Thread Bart Van Assche
On Thu, 2017-10-26 at 07:30 +0200, Bart Van Assche wrote: > +static void virtblk_initialize_rq(struct request *req) > +{ > + struct virtblk_req *vbr = blk_mq_rq_to_pdu(req); > + > + scsi_req_init(>sreq); > +} Please ignore v3 - the build fails with this version for C

Re: [PATCH v2] virtio_blk: Fix an SG_IO regression

2017-10-25 Thread Bart Van Assche
On Wed, 2017-10-25 at 11:23 -0700, Jens Axboe wrote: > On 10/25/2017 02:56 AM, Bart Van Assche wrote: > > Avoid that submitting an SG_IO ioctl triggers a kernel oops that > > is preceded by: > > > > usercopy: kernel memory overwrite attempt detected to (null) () (6

Re: [PATCH v2] virtio_blk: Fix an SG_IO regression

2017-10-25 Thread Bart Van Assche
On Wed, 2017-10-25 at 21:37 +0200, h...@lst.de wrote: > Honestly I think the right fix is to just kill the SCSI passthrough > in virtio. It has been replaced by virtio-scsi a long time ago, and > has been disabled by default in qemu for a long time (and I don't > think any other hypervisor ever

Re: [PATCH v2] virtio_blk: Fix an SG_IO regression

2017-10-25 Thread Bart Van Assche
On Wed, 2017-10-25 at 12:34 -0700, Jens Axboe wrote: > On 10/25/2017 12:25 PM, Bart Van Assche wrote: > > On Wed, 2017-10-25 at 11:23 -0700, Jens Axboe wrote: > > > On 10/25/2017 02:56 AM, Bart Van Assche wrote: > > > > Avoid that submitting an SG_I

[PATCH v2] virtio_blk: Fix an SG_IO regression

2017-10-25 Thread Bart Van Assche
: Make most scsi_req_init() calls implicit") Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Tested-by: Dann Frazier <dann.fraz...@canonical.com> Cc: Michael S. Tsirkin <m...@redhat.com> Cc: Dann Frazier <dann.fraz...@canonical.com> Cc: <sta...@vger.kernel.org&g

Re: [bug report] regression bisected to "block: Make most scsi_req_init() calls implicit"

2017-10-20 Thread Bart Van Assche
On Fri, 2017-10-20 at 16:54 -0600, dann frazier wrote: > hey, > I'm seeing a regression when executing 'dmraid -r -c' in an arm64 > QEMU guest, which I've bisected to the following commit: > > ca18d6f7 "block: Make most scsi_req_init() calls implicit" > > I haven't yet had time to try and

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

2017-10-21 Thread Bart Van Assche
On Sat, 2017-10-21 at 17:59 +, Bart Van Assche wrote: > On Sat, 2017-10-21 at 19:21 +0200, Oleksandr Natalenko wrote: > > I've cherry-picked this series for current upstream/master branch, and got > > this while performing another suspend try: > > > > === > >

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

2017-10-21 Thread Bart Van Assche
On Sat, 2017-10-21 at 19:21 +0200, Oleksandr Natalenko wrote: > I've cherry-picked this series for current upstream/master branch, and got > this while performing another suspend try: > > === > [ 62.415890] Freezing of tasks failed after 20.007 seconds (1 tasks > refusing > to freeze,

Re: [RESEND PATCH 1/3] completion: Add support for initializing completion with lockdep_map

2017-10-20 Thread Bart Van Assche
On Fri, 2017-10-20 at 08:34 +0200, Thomas Gleixner wrote: > On Thu, 19 Oct 2017, Bart Van Assche wrote: > > Are there any completion objects for which the cross-release checking is > > useful? > > All of them by definition. Sorry but I'm not sure that's the best possible

Re: [PATCH 1/1] [RFC] blk-mq: fix queue stalling on shared hctx restart

2017-10-20 Thread Bart Van Assche
On Fri, 2017-10-20 at 11:39 +0200, Roman Penyaev wrote: > But what bothers me is these looong loops inside blk_mq_sched_restart(), > and since you are the author of the original 6d8c6c0f97ad ("blk-mq: Restart > a single queue if tag sets are shared") I want to ask what was the original > problem

[PATCH v11 5/7] block: Add the QUEUE_FLAG_PREEMPT_ONLY request queue flag

2017-10-30 Thread Bart Van Assche
This flag will be used in the next patch to let the block layer core know whether or not a SCSI request queue has been quiesced. A quiesced SCSI queue namely only processes RQF_PREEMPT requests. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Reviewed-by: Hannes Reinecke <h...

[PATCH v11 7/7] block, nvme: Introduce blk_mq_req_flags_t

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

[PATCH v11 0/7] block, scsi, md: Improve suspend and resume

2017-10-30 Thread Bart Van Assche
comments. Changes compared to v1 of this patch series: - Changed the approach and rewrote the patch series. Bart Van Assche (6): block: Introduce blk_get_request_flags() block: Introduce BLK_MQ_REQ_PREEMPT ide, scsi: Tell the block layer at request allocation time about preempt requests

[PATCH v11 2/7] block: Introduce blk_get_request_flags()

2017-10-30 Thread Bart Van Assche
A side effect of this patch is that the GFP mask that is passed to several allocation functions in the legacy block layer is changed from GFP_KERNEL into __GFP_DIRECT_RECLAIM. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Reviewed-by: Hannes Reinecke <h...@suse.com> Teste

[PATCH v11 1/7] block: Make q_usage_counter also track legacy requests

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

[PATCH v11 6/7] block, scsi: Make SCSI quiesce and resume work reliably

2017-10-30 Thread Bart Van Assche
ng ..." >>hibernate-test-log.txt systemctl hibernate sleep 10 kill "${pids[@]}" echo idle > /sys/block/md0/md/sync_action wait echo "$(date) Done." >>hibernate-test-log.txt done Reported-by: Oleksandr Natalenko <oleksa...@natalenko.name

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

2017-10-30 Thread Bart Van Assche
Convert blk_get_request(q, op, __GFP_RECLAIM) into blk_get_request_flags(q, op, BLK_MQ_PREEMPT). This patch does not change any functionality. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Tested-by: Martin Steigerwald <mar...@lichtvoll.de> Acked-by: David S. Miller <da..

Re: [PATCH V2 0/2] block: remove unnecessary RESTART

2017-10-30 Thread Bart Van Assche
On Fri, 2017-10-27 at 13:38 +0800, Ming Lei wrote: > On Fri, Oct 27, 2017 at 04:53:18AM +0000, Bart Van Assche wrote: > > On Fri, 2017-10-27 at 12:43 +0800, Ming Lei wrote: > > > The 1st patch removes the RESTART for TAG-SHARED because SCSI handles it > > > by itself,

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

2017-10-30 Thread Bart Van Assche
On Wed, 2017-10-18 at 15:57 -0500, Brian King wrote: > On 10/17/2017 01:19 AM, Hannes Reinecke wrote: > > On 10/17/2017 12:49 AM, Bart Van Assche wrote: > > > [ ... ] > > > > Not sure if this is a valid conversion. > > Originally the driver would allocate a si

Re: [PATCH] ide:ide-cd: fix kernel panic resulting from missing scsi_req_init

2017-10-31 Thread Bart Van Assche
On Tue, 2017-10-31 at 15:39 +0800, Hongxu Jia wrote: > Since we split the scsi_request out of struct request, while the > standard prep_rq_fn builds 10 byte cmds, it missed to invoke > scsi_req_init() to initialize certain fields of a scsi_request > structure (.__cmd[], .cmd, .cmd_len and

Re: [PATCH v4] virtio_blk: Fix an SG_IO regression

2017-10-28 Thread Bart Van Assche
On Fri, 2017-10-27 at 08:24 -0600, Jens Axboe wrote: > On 10/27/2017 12:39 AM, Christoph Hellwig wrote: > > How about only defininig the initialize_rq method and implementation > > if CONFIG_VIRTIO_BLK_SCSI is set? > > I did that while merging it. Thanks Jens and Christoph! Bart.

Re: [PATCH] block: Fix a race between blk_cleanup_queue() and timeout handling

2017-10-30 Thread Bart Van Assche
On Thu, 2017-10-19 at 10:00 -0700, Bart Van Assche wrote: > Make sure that if the timeout timer fires after a queue has been > marked "dying" that the affected requests are finished. > > Reported-by: chenxiang (M) <chenxian...@hisilicon.com> > Fixes: commit 28792

Re: [PATCH V2 0/2] block: remove unnecessary RESTART

2017-10-31 Thread Bart Van Assche
On Tue, 2017-10-31 at 09:47 +0800, Ming Lei wrote: > On Mon, Oct 30, 2017 at 08:24:57PM +0000, Bart Van Assche wrote: > > On Fri, 2017-10-27 at 13:38 +0800, Ming Lei wrote: > > > On Fri, Oct 27, 2017 at 04:53:18AM +0000, Bart Van Assche wrote: > > > > On Fri, 2017-

Re: [PATCH] blk-mq: Rework blk-mq timeout handling again

2018-05-13 Thread Bart Van Assche
On Mon, 2018-05-14 at 09:37 +0800, jianchao.wang wrote: > In addition, on a 64bit system, how do you set up the timer with a 32bit > deadline ? If timeout handling occurs less than (1 << 31) / HZ seconds after a request has been submitted then a 32-bit variable is sufficient to store the

Re: [PATCH 1/6] scsi/osd: remove the gfp argument to osd_start_request

2018-05-14 Thread Bart Van Assche
On Wed, 2018-05-09 at 09:54 +0200, Christoph Hellwig wrote: > Always GFP_KERNEL, and keeping it would cause serious complications for > the next change. This patch description is very brief. Shouldn't the description of this patch mention whether or not any functionality is changed (I think no

Re: [PATCH 3/6] block: sanitize blk_get_request calling conventions

2018-05-14 Thread Bart Van Assche
On Wed, 2018-05-09 at 09:54 +0200, Christoph Hellwig wrote: > Switch everyone to blk_get_request_flags, and then rename > blk_get_request_flags to blk_get_request. Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH 5/6] block: use GFP_NOIO instead of __GFP_DIRECT_RECLAIM

2018-05-14 Thread Bart Van Assche
On Wed, 2018-05-09 at 09:54 +0200, Christoph Hellwig wrote: > We just can't do I/O when doing block layer requests allocations, > so use GFP_NOIO instead of the even more limited __GFP_DIRECT_RECLAIM. Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH 6/6] block: consistently use GFP_NOIO instead of __GFP_NORECLAIM

2018-05-14 Thread Bart Van Assche
On Wed, 2018-05-09 at 09:54 +0200, Christoph Hellwig wrote: > Same numerical value (for now at least), but a much better documentation > of intent. There is a typo in the subject of this patch: __GFP_NORECLAIM should be changed into __GFP_RECLAIM. Otherwise: Reviewed-by: Bart Van

Re: [PATCH 4/6] block: pass an explicit gfp_t to get_request

2018-05-14 Thread Bart Van Assche
On Wed, 2018-05-09 at 09:54 +0200, Christoph Hellwig wrote: > blk_old_get_request already has it at hand, and in blk_queue_bio, which > is the fast path, it is constant. Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH 2/6] block: fix __get_request documentation

2018-05-14 Thread Bart Van Assche
On Wed, 2018-05-09 at 09:54 +0200, Christoph Hellwig wrote: > Signed-off-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH v9 1/2] arch/*: Add CONFIG_ARCH_HAVE_CMPXCHG64

2018-05-14 Thread Bart Van Assche
On Mon, 2018-05-14 at 11:50 -0700, Max Filippov wrote: > On Mon, May 14, 2018 at 11:46 AM, Bart Van Assche > <bart.vanass...@wdc.com> wrote: > > The next patch in this series introduces a call to cmpxchg64() > > in the block layer core for those architectures on whic

Re: [PATCH 0/7] psi: pressure stall information for CPU, memory, and IO

2018-05-14 Thread Bart Van Assche
On 05/14/18 08:39, Christopher Lameter wrote: On Mon, 7 May 2018, Johannes Weiner wrote: What to make of this number? If CPU utilization is at 100% and CPU pressure is 0, it means the system is perfectly utilized, with one runnable thread per CPU and nobody waiting. At two or more runnable

[PATCH v9 2/2] blk-mq: Rework blk-mq timeout handling again

2018-05-14 Thread Bart Van Assche
to two functions - one for the legacy block layer and one for blk-mq. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Tejun Heo <t...@kernel.org> Cc: Christoph Hellwig <h...@lst.de> Cc: Jianchao Wang <jianchao.w.w...@oracle.com> Cc: Ming Lei <ming@redhat.c

[PATCH v9 1/2] arch/*: Add CONFIG_ARCH_HAVE_CMPXCHG64

2018-05-14 Thread Bart Van Assche
The next patch in this series introduces a call to cmpxchg64() in the block layer core for those architectures on which this functionality is available. Make it possible to test whether cmpxchg64() is available by introducing CONFIG_ARCH_HAVE_CMPXCHG64. Signed-off-by: Bart Van Assche <bart.van

[PATCH v9 0/2] blk-mq: Rework blk-mq timeout handling again

2018-05-14 Thread Bart Van Assche
ct request and used the __deadline member to encode both the generation and state information. Bart Van Assche (2): arch/*: Add CONFIG_ARCH_HAVE_CMPXCHG64 blk-mq: Rework blk-mq timeout handling again .../features/locking/cmpxchg64/arch-support.txt| 31 ar

Re: [PATCH] blk-mq: Rework blk-mq timeout handling again

2018-05-14 Thread Bart Van Assche
On Mon, 2018-05-14 at 13:15 +0800, jianchao.wang wrote: > a 32bit deadline is indeed OK to judge whether a request is timeout or not. > but how is the expires value determined for __blk_add_timer -> mod_timer ? > as we know, when a request is started, we need to arm a timer for it. > the expires

Re: [PATCH 0/3] scsi: scsi-mq: don't hold host_busy in IO path

2018-04-27 Thread Bart Van Assche
On Fri, 2018-04-20 at 14:57 +0800, Ming Lei wrote: > This patches removes the expensive atomic opeation on host-wide counter > of .host_busy for scsi-mq, and it is observed that IOPS can be increased by > 15% with this change in IO test over scsi_debug. > > > Ming Lei (3): > scsi: introduce

Re: [PATCH 3/3] scsi: avoid to hold host-wide counter of host_busy for scsi_mq

2018-04-27 Thread Bart Van Assche
On Fri, 2018-04-20 at 14:57 +0800, Ming Lei wrote: > +struct scsi_host_mq_in_flight { > + int cnt; > +}; > + > +static void scsi_host_check_in_flight(struct request *rq, void *data, > + bool reserved) > +{ > + struct scsi_host_mq_in_flight *in_flight = data; > + > + if

Re: [PATCH 1/3] scsi: introduce scsi_host_busy()

2018-04-27 Thread Bart Van Assche
On Fri, 2018-04-20 at 14:57 +0800, Ming Lei wrote: > This patch introduces SCSI middle layer API of scsi_host_busy() for > drivers to read the host-wide counter of scsi_host->host_busy. This patch introduces a function that has no callers so I think this patch should be combined with patch 2/3

Re: [PATCH 0/3] scsi: scsi-mq: don't hold host_busy in IO path

2018-04-27 Thread Bart Van Assche
On Fri, 2018-04-27 at 09:39 -0600, Jens Axboe wrote: > blk_mq_tagset_busy_iter(>tag_set, scsi_host_check_in_flight, > _flight); > return in_flight.cnt + atomic_read(>host_busy); > > The atomic read is basically free, once we get rid of the dirty of that > variable on each

Re: [PATCH 2/2] tracing/events: block: dev_t via driver core for plug and unplug events

2018-04-27 Thread Bart Van Assche
On Tue, 2018-04-24 at 16:49 +0200, Steffen Maier wrote: > The object life cycle seems to be: > > (1) blk_alloc_queue() also creates gendisk kobj I think this is a misinterpretation. blk_alloc_queue_node() initializes the request queue kobj as follows: kobject_init(>kobj, _queue_ktype);

Re: [PATCH 2/3] scsi: read host_busy via scsi_host_busy()

2018-04-27 Thread Bart Van Assche
On Fri, 2018-04-20 at 14:57 +0800, Ming Lei wrote: > show_host_busy(struct device *dev, struct device_attribute *attr, char *buf) > { > struct Scsi_Host *shost = class_to_shost(dev); > - return snprintf(buf, 20, "%d\n", atomic_read(>host_busy)); > + return snprintf(buf, 20, "%d\n",

Re: v4.16-rc1 + dm-mpath + BFQ

2018-05-10 Thread Bart Van Assche
On Fri, 2018-05-04 at 16:42 -0400, Laurence Oberman wrote: > I was never able to reproduce Barts original issue using his tree and > actual mlx5/cx4 hardware and ibsrp > I enabled BFQ with no other special tuning for the moath and subpaths. > I was waiting for him to come back from vacation to

Re: [PATCH V4 1/7] block: introduce blk_quiesce_timeout() and blk_unquiesce_timeout()

2018-05-10 Thread Bart Van Assche
On Sat, 2018-05-05 at 21:58 +0800, Ming Lei wrote: > Turns out the current way can't drain timout completely because mod_timer() > can be triggered in the work func, which can be just run inside the synced > timeout work: > > del_timer_sync(>timeout); >

Re: v4.16-rc1 + dm-mpath + BFQ

2018-05-10 Thread Bart Van Assche
On Fri, 2018-05-04 at 22:11 +0200, Paolo Valente wrote: > > Il giorno 30 mar 2018, alle ore 18:57, Bart Van Assche > > <bart.vanass...@wdc.com> ha scritto: > > > > On Fri, 2018-03-30 at 10:23 +0200, Paolo Valente wrote: > > > Still 4.16-rc1, being

Re: [PATCH BUGFIX] block, bfq: postpone rq preparation to insert or merge

2018-05-10 Thread Bart Van Assche
On Fri, 2018-05-04 at 19:17 +0200, Paolo Valente wrote: > When invoked for an I/O request rq, [ ... ] Tested-by: Bart Van Assche <bart.vanass...@wdc.com>

[PATCH] blk-mq: Rework blk-mq timeout handling again

2018-05-10 Thread Bart Van Assche
) has been split into two functions - one for the legacy block layer and one for blk-mq. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Tejun Heo <t...@kernel.org> Cc: Christoph Hellwig <h...@lst.de> Cc: Ming Lei <ming@redhat.com> Cc: Sebastian Ott <

Re: [PATCH] blk-mq: Rework blk-mq timeout handling again

2018-05-11 Thread Bart Van Assche
On Fri, 2018-05-11 at 20:06 +0800, jianchao.wang wrote: > Hi bart > > I add debug log in blk_mq_add_timer as following > > void blk_mq_add_timer(struct request *req, enum mq_rq_state old, > enum mq_rq_state new) > { >struct request_queue *q = req->q; > >if

Re: [PATCH] blk-mq: Rework blk-mq timeout handling again

2018-05-11 Thread Bart Van Assche
On Fri, 2018-05-11 at 14:35 +0200, Christoph Hellwig wrote: > > It should be due to union blk_deadline_and_state. > > +union blk_deadline_and_state { > > + struct { > > + uint32_t generation:30; > > + uint32_t state:2; > > + uint32_t deadline; > > + }; > > +

[PATCH v8] blk-mq: Rework blk-mq timeout handling again

2018-05-11 Thread Bart Van Assche
to two functions - one for the legacy block layer and one for blk-mq. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Tejun Heo <t...@kernel.org> Cc: Christoph Hellwig <h...@lst.de> Cc: Jianchao Wang <jianchao.w.w...@oracle.com> Cc: Ming Lei <

Re: [PATCH v8] blk-mq: Rework blk-mq timeout handling again

2018-05-11 Thread Bart Van Assche
On Fri, 2018-05-11 at 15:21 -0600, Jens Axboe wrote: > On 5/11/18 3:08 PM, Bart Van Assche wrote: > blk_mq_rq_update_aborted_gstate(rq, gstate); > > + union blk_deadline_and_state das = READ_ONCE(rq->das); > > + unsigned long now = jiffies; > > + int32_t diff_j

Re: [PATCH v9 1/2] arch/*: Add CONFIG_ARCH_HAVE_CMPXCHG64

2018-05-15 Thread Bart Van Assche
On Tue, 2018-05-15 at 12:54 +1000, Michael Ellerman wrote: > Bart Van Assche <bart.vanass...@wdc.com> writes: > > > > +--- > > +| arch |status| > > +--- > > +| alpha:

Re: [PATCH 00/10] Misc block layer patches for bcachefs

2018-05-20 Thread Bart Van Assche
On Sun, 2018-05-20 at 18:31 -0400, Kent Overstreet wrote: > On Sun, May 20, 2018 at 10:19:13PM +0000, Bart Van Assche wrote: > > On Sun, 2018-05-20 at 18:17 -0400, Kent Overstreet wrote: > > > On Fri, May 18, 2018 at 03:12:27PM +0000, Bart Van Assche wrote: > > > &g

Re: [PATCH 00/10] Misc block layer patches for bcachefs

2018-05-20 Thread Bart Van Assche
On Sun, 2018-05-20 at 19:00 -0400, Kent Overstreet wrote: > On Sun, May 20, 2018 at 10:35:29PM +0000, Bart Van Assche wrote: > > On Sun, 2018-05-20 at 18:31 -0400, Kent Overstreet wrote: > > > On Sun, May 20, 2018 at 10:19:13PM +0000, Bart Van Assche wrote: > > > &g

Re: [PATCH 00/10] Misc block layer patches for bcachefs

2018-05-20 Thread Bart Van Assche
On Sun, 2018-05-20 at 18:17 -0400, Kent Overstreet wrote: > On Fri, May 18, 2018 at 03:12:27PM +0000, Bart Van Assche wrote: > > On Fri, 2018-05-18 at 05:06 -0400, Kent Overstreet wrote: > > > On Thu, May 17, 2018 at 08:54:57PM +0000, Bart Van Assche wrote: > > > &

Re: [PATCH 00/10] Misc block layer patches for bcachefs

2018-05-20 Thread Bart Van Assche
On Sun, 2018-05-20 at 19:21 -0400, Kent Overstreet wrote: > I really have better things to do than debug someone else's tests... > [ ... ] > ../run_tests: line 65: cd: /lib/modules/4.16.0+/kernel/block: No such file or > directory Kernel v4.16 is too old to run these tests. The srp-test script

Re: [PATCH v9 2/2] blk-mq: Rework blk-mq timeout handling again

2018-05-16 Thread Bart Van Assche
On Wed, 2018-05-16 at 14:51 +0200, Christoph Hellwig wrote: > I've been looking at this carefully, and I don't think we need cmpxchg64 > at all, and we don't need anywhere near as many cmpxchg operations either. > > The only reason to include the deadline in the atomic operation is the >

Re: INFO: task hung in blk_queue_enter

2018-05-16 Thread Bart Van Assche
On Wed, 2018-05-16 at 22:05 +0900, Tetsuo Handa wrote: > One ore more threads are waiting for q->mq_freeze_depth to become 0. But the > thread who incremented q->mq_freeze_depth at blk_freeze_queue_start(q) from > blk_freeze_queue() is waiting at blk_mq_freeze_queue_wait(). Therefore, >

Re: INFO: task hung in blk_queue_enter

2018-05-16 Thread Bart Van Assche
On Wed, 2018-05-16 at 17:16 +0200, Dmitry Vyukov wrote: > On Wed, May 16, 2018 at 4:56 PM, Bart Van Assche <bart.vanass...@wdc.com> > wrote: > > On Wed, 2018-05-16 at 22:05 +0900, Tetsuo Handa wrote: > > > diff --git a/block/blk-core.c b/block/blk-core.c > >

Re: [PATCH 2/2] nbd: don't start req until after the dead connection logic

2018-05-17 Thread Bart Van Assche
On Thu, 2017-10-19 at 16:21 -0400, Josef Bacik wrote: > + blk_mq_start_request(req); > if (unlikely(nsock->pending && nsock->pending != req)) { > blk_mq_requeue_request(req, true); > ret = 0; (replying to an e-mail from seven months ago) Hello Josef, Are

Re: [PATCH v9 2/2] blk-mq: Rework blk-mq timeout handling again

2018-05-16 Thread Bart Van Assche
On Wed, 2018-05-16 at 18:24 +0200, h...@lst.de wrote: > On Wed, May 16, 2018 at 04:17:42PM +0000, Bart Van Assche wrote: > > There is another reason the deadline is included in the atomic operation, > > namely to handle races between the BLK_EH_RESET_TIMER case in > >

Re: [PATCH v9 2/2] blk-mq: Rework blk-mq timeout handling again

2018-05-16 Thread Bart Van Assche
On Wed, 2018-05-16 at 19:31 +0200, h...@lst.de wrote: > On Wed, May 16, 2018 at 04:47:54PM +0000, Bart Van Assche wrote: > > I think your patch changes the order of changing the request state and > > calling mod_timer(). In my patch the request state and the deadline are &g

Re: [PATCH v11 1/2] arch/*: Add CONFIG_ARCH_HAVE_CMPXCHG64

2018-05-21 Thread Bart Van Assche
On Fri, 2018-05-18 at 11:32 -0700, h...@zytor.com wrote: > On May 18, 2018 11:00:05 AM PDT, Bart Van Assche <bart.vanass...@wdc.com> > wrote: > > The next patch in this series introduces a call to cmpxchg64() > > in the block layer core for those architectures on whic

Re: [PATCH 00/10] Misc block layer patches for bcachefs

2018-05-21 Thread Bart Van Assche
On Sun, 2018-05-20 at 19:58 -0400, Kent Overstreet wrote: > On Sun, May 20, 2018 at 11:40:45PM +0000, Bart Van Assche wrote: > > On Sun, 2018-05-20 at 19:21 -0400, Kent Overstreet wrote: > > > I really have better things to do than debug someone else's tests... > > >

[PATCH v12 0/2] blk-mq: Rework blk-mq timeout handling again

2018-05-21 Thread Bart Van Assche
etested on top of kernel v4.16. Changes compared to v1 (https://www.mail-archive.com/linux-block@vger.kernel.org/msg18089.html): - Removed the gstate and aborted_gstate members of struct request and used the __deadline member to encode both the generation and state information. Bart Van Assche (2):

[PATCH v12 1/2] ARM: cmpxchg64: Only define cmpxchg64() if not using the Thumb instruction set

2018-05-21 Thread Bart Van Assche
Since the implementation of cmpxchg64() uses instructions that are not Thumb instructions, only define cmpxchg64() if not building in Thumb mode. This patch allows the next patch in this series to check for cmpxchg64() support using #if defined(cmpxchg64). Signed-off-by: Bart Van Assche

[PATCH v12 2/2] blk-mq: Rework blk-mq timeout handling again

2018-05-21 Thread Bart Van Assche
ion. - Atomic instructions are only used to update the request state if a concurrent request state change could be in progress. - blk_add_timer() has been split into two functions - one for the legacy block layer and one for blk-mq. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com&g

Re: [PATCH 00/10] Misc block layer patches for bcachefs

2018-05-21 Thread Bart Van Assche
On Mon, 2018-05-21 at 11:37 -0700, Omar Sandoval wrote: > Have you made any progress in porting srp-test to blktests so we don't > have to have this conversation again? Hello Omar, Porting the srp-test software to the blktests framework is still high on my to-do list. I will start working on

[PATCH] block: Verify whether blk_queue_enter() is used when necessary

2018-05-21 Thread Bart Van Assche
: Bart Van Assche <bart.vanass...@wdc.com> Cc: Tejun Heo <t...@kernel.org> --- block/blk-cgroup.c | 2 ++ block/blk-core.c| 24 include/linux/blk-cgroup.h | 2 ++ include/linux/blkdev.h | 11 +++ include/linux

Re: [RFC PATCH 3/3] blk-mq: Remove generation seqeunce

2018-05-21 Thread Bart Van Assche
On Mon, 2018-05-21 at 17:11 -0600, Keith Busch wrote: > @@ -650,27 +600,10 @@ static u64 blk_mq_rq_aborted_gstate(struct request *rq) > void blk_mq_complete_request(struct request *rq) > { > struct request_queue *q = rq->q; > - struct blk_mq_hw_ctx *hctx = blk_mq_map_queue(q,

Re: [RFC PATCH 0/3] blk-mq: Timeout rework

2018-05-21 Thread Bart Van Assche
On Mon, 2018-05-21 at 17:11 -0600, Keith Busch wrote: > The current blk-mq code potentially locks requests out of completion by > the thousands, making drivers jump through hoops to handle them. This > patch set allows drivers to complete their requests whenever they're > completed without

[PATCH] blkdev_report_zones_ioctl(): Use vmalloc() to allocate large buffers

2018-05-22 Thread Bart Van Assche
SyS_ioctl+0x79/0x90 do_syscall_64+0x79/0x1b0 entry_SYSCALL_64_after_hwframe+0x3d/0xa2 Fixes: 3ed05a987e0f ("blk-zoned: implement ioctls") Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Shaun Tancheff <shaun.tanch...@seagate.com> Cc: Damien Le Moal <damien.lem..

[PATCH v13] blk-mq: Rework blk-mq timeout handling again

2018-05-22 Thread Bart Van Assche
: - Atomic instructions are only used to update the request state if a concurrent request state change could be in progress. - blk_add_timer() has been split into two functions - one for the legacy block layer and one for blk-mq. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Tejun Heo

Re: [RFC PATCH 3/3] blk-mq: Remove generation seqeunce

2018-05-22 Thread Bart Van Assche
On Tue, 2018-05-22 at 08:15 -0600, Keith Busch wrote: > This shouldn't be introducing any new concorrent calls to > __blk_mq_complete_request if they don't already exist. The timeout work > calls it only if the driver's timeout returns BLK_EH_HANDLED, which means > the driver is claiming the

Re: [RFC PATCH 3/3] blk-mq: Remove generation seqeunce

2018-05-22 Thread Bart Van Assche
On Tue, 2018-05-22 at 10:34 -0600, Keith Busch wrote: > On Tue, May 22, 2018 at 04:29:07PM +0000, Bart Van Assche wrote: > > Please have another look at the current code that handles request timeouts > > and completions. The current implementation guarantees that no double >

Re: [RFC PATCH 2/3] blk-mq: Fix timeout and state order

2018-05-22 Thread Bart Van Assche
On Tue, 2018-05-22 at 17:24 +0200, Christoph Hellwig wrote: > On Mon, May 21, 2018 at 05:11:30PM -0600, Keith Busch wrote: > > The block layer had been setting the state to in-flight prior to updating > > the timer. This is the wrong order since the timeout handler could observe > > the in-flight

Re: [RFC PATCH 0/3] blk-mq: Timeout rework

2018-05-22 Thread Bart Van Assche
On Tue, 2018-05-22 at 08:06 -0600, Keith Busch wrote: > On Mon, May 21, 2018 at 11:29:21PM +0000, Bart Van Assche wrote: > > Can you explain why the NVMe driver needs reference counting of requests but > > no other block driver needs this? Additionally, why is it that for all bl

Re: [PATCH] Revert "block: Add warning for bi_next not NULL in bio_endio()"

2018-05-22 Thread Bart Van Assche
On Tue, 2018-05-22 at 21:30 -0400, Kent Overstreet wrote: > On Tue, May 22, 2018 at 04:55:05PM -0700, Bart Van Assche wrote: > > This patch avoids that KASAN reports the following complaint when > > running the srp-test software: > > I made a real attempt to get your test s

Re: [PATCH v13] blk-mq: Rework blk-mq timeout handling again

2018-05-22 Thread Bart Van Assche
On Tue, 2018-05-22 at 14:38 -0600, Jens Axboe wrote: > On 5/22/18 2:33 PM, Bart Van Assche wrote: > > Thanks for having reported this. How about using the following change to > > suppress > > that warning: > > > > diff --git a/block/blk-mq.c b/block/blk-mq.c >

[PATCH] Revert "block: Add warning for bi_next not NULL in bio_endio()"

2018-05-22 Thread Bart Van Assche
f-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Kent Overstreet <kent.overstr...@gmail.com> --- block/bio.c | 3 --- block/blk-core.c | 8 +--- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/block/bio.c b/block/bio.c index 0a4df92cd689..e22ebab450f8 100644 -

Re: [PATCH v13] blk-mq: Rework blk-mq timeout handling again

2018-05-22 Thread Bart Van Assche
On Tue, 2018-05-22 at 14:33 -0600, Keith Busch wrote: > On Tue, May 22, 2018 at 09:25:15AM -0700, Bart Van Assche wrote: > > @@ -848,13 +843,22 @@ static void blk_mq_rq_timed_out(struct request *req, > > bool reserved) > > case BLK_EH_RESET_TIMER: > > +

Re: [PATCH 00/10] Misc block layer patches for bcachefs

2018-05-22 Thread Bart Van Assche
On Sun, 2018-05-20 at 18:17 -0400, Kent Overstreet wrote: > On Fri, May 18, 2018 at 03:12:27PM +0000, Bart Van Assche wrote: > > On Fri, 2018-05-18 at 05:06 -0400, Kent Overstreet wrote: > > > On Thu, May 17, 2018 at 08:54:57PM +0000, Bart Van Assche wrote: > > > &

Re: [PATCH v13] blk-mq: Rework blk-mq timeout handling again

2018-05-22 Thread Bart Van Assche
On Tue, 2018-05-22 at 14:44 -0600, Keith Busch wrote: > On Tue, May 22, 2018 at 08:36:27PM +0000, Bart Van Assche wrote: > > > > Have you noticed that if blk_mq_complete_request() encounters a request with > > state MQ_RQ_TIMED_OUT that it doesn't call __blk_mq_complete_re

Re: [PATCH v13] blk-mq: Rework blk-mq timeout handling again

2018-05-22 Thread Bart Van Assche
On Tue, 2018-05-22 at 13:38 -0600, Jens Axboe wrote: > On 5/22/18 1:03 PM, Jens Axboe wrote: > > On 5/22/18 12:47 PM, Jens Axboe wrote: > > > Ran into this, running block/014 from blktests: > > > > > > [ 5744.949839] run blktests block/014 at 2018-05-22 12:41:25 > > > [ 5750.723000] null: rq

Re: [PATCH 00/10] Misc block layer patches for bcachefs

2018-05-18 Thread Bart Van Assche
On Fri, 2018-05-18 at 05:06 -0400, Kent Overstreet wrote: > On Thu, May 17, 2018 at 08:54:57PM +0000, Bart Van Assche wrote: > > With Jens' latest for-next branch I hit the kernel warning shown below. Can > > you have a look? > > Any hints on how to reproduce it? Sure. Th

Re: blk-mq: make sure that correct hctx->dispatch_from is set

2018-05-18 Thread Bart Van Assche
On Fri, 2018-05-18 at 22:46 +0800, huhai wrote: > Yes, it is more readable > > Finally, thank you for reminding me. Next time I'll change gmail to submit > patch. Hello Huhai, Please have a look at Documentation/process/email-clients.rst. Thanks, Bart.

Re: [PATCH 00/10] Misc block layer patches for bcachefs

2018-05-17 Thread Bart Van Assche
On Tue, 2018-05-08 at 21:33 -0400, Kent Overstreet wrote: > [ ... ] Hello Kent, With Jens' latest for-next branch I hit the kernel warning shown below. Can you have a look? Thanks, Bart. == BUG: KASAN: use-after-free in

Re: [PATCH 2/2] nbd: don't start req until after the dead connection logic

2018-05-17 Thread Bart Van Assche
On Thu, 2018-05-17 at 14:41 -0400, Josef Bacik wrote: > Yup I can tell you why, on 4.11 where I originally did this work > __blk_mq_requeue_request() did this > > static void __blk_mq_requeue_request(struct request *rq) > { > struct request_queue *q = rq->q; > >

[PATCH v11 1/2] arch/*: Add CONFIG_ARCH_HAVE_CMPXCHG64

2018-05-18 Thread Bart Van Assche
The next patch in this series introduces a call to cmpxchg64() in the block layer core for those architectures on which this functionality is available. Make it possible to test whether cmpxchg64() is available by introducing CONFIG_ARCH_HAVE_CMPXCHG64. Signed-off-by: Bart Van Assche <bart.van

[PATCH v11 2/2] blk-mq: Rework blk-mq timeout handling again

2018-05-18 Thread Bart Van Assche
ion. - Atomic instructions are only used to update the request state if a concurrent request state change could be in progress. - blk_add_timer() has been split into two functions - one for the legacy block layer and one for blk-mq. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com&g

[PATCH v11 0/2] blk-mq: Rework blk-mq timeout handling again

2018-05-18 Thread Bart Van Assche
state members of struct request and used the __deadline member to encode both the generation and state information. Bart Van Assche (2): arch/*: Add CONFIG_ARCH_HAVE_CMPXCHG64 blk-mq: Rework blk-mq timeout handling again .../features/locking/cmpxchg64/arc

[PATCH v3 2/2] block: Ensure that a request queue is dissociated from the cgroup controller

2018-05-18 Thread Bart Van Assche
eue removal and the block cgroup controller") Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Tested-by: Alexandru Moise <00moses.alexande...@gmail.com> Cc: Tejun Heo <t...@kernel.org> Cc: Alexandru Moise <00moses.alexande...@gmail.com> Cc: Joseph Qi <joseph..

[PATCH v3 1/2] block: Introduce blk_exit_queue()

2018-05-18 Thread Bart Van Assche
This patch does not change any functionality. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Alexandru Moise <00moses.alexande...@gmail.com> Cc: Hannes Reinecke <h...@suse.com> Cc: Ming Lei <ming@redhat.com> Cc: Omar Sandoval <osan...@fb

<    8   9   10   11   12   13   14   15   16   17   >