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(&q->timeout); > cancel_work_sync(&q->time

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 chec

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 > > ha scritto: > > > > On Fri, 2018-03-30 at 10:23 +0200, Paolo Valente wrote: > > > Still 4.16-rc1, being that the version for which you repor

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

[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 Cc: Tejun Heo Cc: Christoph Hellwig Cc: Ming Lei Cc: Sebastian Ott Cc: Sagi Grimberg Cc: Israel Rukshin , Cc: Max Gurtovoy Signed-off-by: Jens Axboe --- Changes compared

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; > > + }; > > + uns

[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 Cc: Tejun Heo Cc: Christoph Hellwig Cc: Jianchao Wang Cc: Ming Lei Cc: Sebastian Ott Cc: Sagi Grimberg Cc: Israel Rukshin , Cc: Max Gurtovoy --- Changes compared to v7: - Fixed the g

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

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 fun

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 Reviewed-by: Bart Van Assche

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

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

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

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 Assche

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 tasks

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 va

[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

[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 Cc: Tejun Heo Cc: Christoph Hellwig Cc: Jianchao Wang Cc: Ming Lei Cc: Sebastian Ott Cc: Sagi Grimberg Cc: Israel Rukshin , Cc: Max Gurtovoy --- block/blk-core.c | 6 -- block/

[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 Cc: Catalin

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 > wrote: > > The next patch in this series introduces a call to cmpxchg64() > > in the block layer core for those architectures on which this > > functionality is ava

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 writes: > > > > +--- > > +| arch |status| > > +--- > > +| alpha: | ok | > > +| arc: |

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

2018-05-15 Thread Bart Van Assche
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| 33 arch/Kconfig

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

2018-05-15 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 Cc: Catalin

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

2018-05-15 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

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

2018-05-15 Thread Bart Van Assche
to two functions - one for the legacy block layer and one for blk-mq. Signed-off-by: Bart Van Assche Cc: Tejun Heo Cc: Christoph Hellwig Cc: Jianchao Wang Cc: Ming Lei Cc: Sebastian Ott Cc: Sagi Grimberg Cc: Israel Rukshin , Cc: Max Gurtovoy --- block/blk-core.c | 6 -- block/

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

2018-05-15 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 Cc: Catalin

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

2018-05-15 Thread Bart Van Assche
to two functions - one for the legacy block layer and one for blk-mq. Signed-off-by: Bart Van Assche Cc: Tejun Heo Cc: Christoph Hellwig Cc: Jianchao Wang Cc: Ming Lei Cc: Sebastian Ott Cc: Sagi Grimberg Cc: Israel Rukshin , Cc: Max Gurtovoy --- block/blk-core.c | 6 -- block/

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

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 > 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 > > > index 85909b4..59e2496 10064

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

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

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 you

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

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 bio_advan

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

[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 Cc: Tejun Heo Cc: Christoph Hellwig

[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 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 Cc: Catalin

[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 Tested-by: Alexandru Moise <00moses.alexande...@gmail.com> Cc: Tejun Heo Cc: Alexandru Moise <00moses.alexande...@gmail.com> Cc: Joseph Qi --- block/blk-sysfs.c | 25 + 1

[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 Cc: Alexandru Moise <00moses.alexande...@gmail.com> Cc: Hannes Reinecke Cc: Ming Lei Cc: Omar Sandoval Cc: Joseph Qi --- block/blk-core.c | 54 ++ block

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

2018-05-18 Thread Bart Van Assche
Van Assche (2): block: Introduce blk_exit_queue() block: Ensure that a request queue is dissociated from the cgroup controller block/blk-core.c | 54 ++ block/blk-sysfs.c | 25 + block/blk.h | 1 + 3 files

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

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

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 > wrote: > > The next patch in this series introduces a call to cmpxchg64() > > in the block layer core for those architectures on which this > > functionali

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

[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 Cc: Tejun Heo Cc: Christoph Hellwig

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

2018-05-21 Thread Bart Van Assche
lockdep to verify whether blkg_lookup() is protected correctly is not possible since lock_acquire() and lock_release() must be called from the same task and since blk_queue_enter() and blk_queue_exit() can be called from different tasks. Suggested-by: Tejun Heo Signed-off-by: Bart Van Assche Cc

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 this

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, rq->mq_ctx

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 requirin

[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 Cc: Shaun Tancheff Cc: Damien Le Moal Cc: Christoph Hellwig Cc: Martin K. Petersen Cc: Hannes Reinecke Cc: ---

[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 Cc: Tejun Heo Cc: Christoph Hellwig Cc: K

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 s

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 comman

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: [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: [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 0

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

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_comple

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

[PATCH v14] 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 Cc: Tejun Heo Cc: Christoph Hellwig Cc: K

[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 Cc: Kent Overstreet --- 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 --- a/block/bio.c +++ b/block/bio.c @@ -1777,9 +1777,6 @@ void

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] Revert "block: Add warning for bi_next not NULL in bio_endio()"

2018-06-04 Thread Bart Van Assche
On Tue, 2018-05-22 at 22:16 -0400, Kent Overstreet wrote: > May 22 22:13:46 moria-kvm-kvm-kvm-kvm multipathd[387]: sda: fail to get serial > May 22 22:13:46 moria-kvm-kvm-kvm-kvm multipathd[387]: sda: using deprecated > getuid callout > May 22 22:13:46 moria-kvm-kvm-kvm-kvm multipathd[387]: > /.../

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

2018-06-05 Thread Bart Van Assche
On Mon, 2018-06-04 at 18:41 -0400, Kent Overstreet wrote: > On Mon, Jun 04, 2018 at 08:59:39AM +0000, Bart Van Assche wrote: > > Please comment out the getuid_callout line from /etc/multipath.conf and try > > again. > > Changing the "/..." part into the path of th

Re: [PATCH 1/1] blk-mq: reinit q->tag_set_list entry only after grace period

2018-06-11 Thread Bart Van Assche
t;blk-mq: Make it safe to use RCU to iterate over blk_mq_tag_set.tag_list") Cc: sta...@vger.kernel.org Anyway: Reviewed-by: Bart Van Assche

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

2018-06-13 Thread Bart Van Assche
On 05/22/18 10:58, Jens Axboe wrote: On 5/22/18 9:27 AM, Bart Van Assche wrote: Avoid that complaints similar to the following appear in the kernel log if the number of zones is sufficiently large: fio: page allocation failure: order:9, mode:0x140c0c0(GFP_KERNEL|__GFP_COMP|__GFP_ZERO

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

2018-06-13 Thread Bart Van Assche
nks, Bart. commit cf0110698846fc5a93df89eb20ac7cc70a860c17 Author: Bart Van Assche Date: Tue May 22 08:27:22 2018 -0700 blkdev_report_zones_ioctl(): Use vmalloc() to allocate large buffers Avoid that complaints similar to the following appear in the kernel log if the number o

Re: [PATCH] dm-zoned-tools: add zoned disk udev rules for scheduler / dmsetup

2018-06-14 Thread Bart Van Assche
On Thu, 2018-06-14 at 10:01 +, Damien Le Moal wrote: > Applied. Thanks Luis ! Hello Damien, Can this still be undone? I agree with Mike that it's wrong to invoke "/sbin/dmsetup create ... zoned ..." from a udev rule. Thanks, Bart.

Re: [PATCH] dm-zoned-tools: add zoned disk udev rules for scheduler / dmsetup

2018-06-14 Thread Bart Van Assche
On Wed, 2018-06-13 at 17:11 -0700, Luis R. Rodriguez wrote: > This tries to put a bit of this tribal knowledge into an initial udev > rule for development with the hopes Linux distributions can later > deploy. Three rule are added. One rule is optional for now, it should be > extended later to be m

Re: dm-zoned-tools: add zoned disk udev rules for scheduler / dmsetup

2018-06-14 Thread Bart Van Assche
On Thu, 2018-06-14 at 08:38 -0400, Mike Snitzer wrote: > On Wed, Jun 13 2018 at 8:11pm -0400, > Luis R. Rodriguez wrote: > > 1) scheduler setup > > This is wrong.. if zoned devices are so dependent on deadline or > mq-deadline then the kernel should allow them to be hardcoded. I know > Jens rem

Re: [PATCH] brd: Allow ramdisk to be allocated on selected NUMA node

2018-06-15 Thread Bart Van Assche
On Thu, 2018-06-14 at 15:38 +0200, Hannes Reinecke wrote: > For performance reasons we should be able to allocate all memory > from a given NUMA node, so this patch adds a new parameter > 'rd_numa_node' to allow the user to specify the NUMA node id. > When restricing fio to use the same NUMA node I

Re: [PATCH] brd: Allow ramdisk to be allocated on selected NUMA node

2018-06-15 Thread Bart Van Assche
On Fri, 2018-06-15 at 18:55 +0200, Hannes Reinecke wrote: > On 06/15/2018 04:07 PM, Bart Van Assche wrote: > > On Thu, 2018-06-14 at 15:38 +0200, Hannes Reinecke wrote: > > > For performance reasons we should be able to allocate all memory > > > from a given NUMA nod

[PATCH 0/5] Five small zoned block device patches

2018-06-15 Thread Bart Van Assche
Hello Jens, In this patch series there are five patches with small improvements for the zoned block device code. Please consider these patches for the upstream kernel. Thanks, Bart. Bart Van Assche (5): block: Remove a superfluous cast from blkdev_report_zones() include/uapi/linux

[PATCH 0/5] Five small zoned block device patches

2018-06-15 Thread Bart Van Assche
Hello Jens, In this patch series there are five patches with small improvements for the zoned block device code. Please consider these patches for the upstream kernel. Thanks, Bart. Bart Van Assche (5): block: Remove a superfluous cast from blkdev_report_zones() include/uapi/linux

[PATCH 2/5] include/uapi/linux/blkzoned.h: Remove a superfluous __packed directive

2018-06-15 Thread Bart Van Assche
-shouldnt-use-__attribute__packed/. Signed-off-by: Bart Van Assche Reviewed-by: Damien Le Moal Cc: Matias Bjorling Cc: Christoph Hellwig --- include/uapi/linux/blkzoned.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/blkzoned.h b/include/uapi/linux

[PATCH 5/5] block: Make struct request_queue smaller for CONFIG_BLK_DEV_ZONED=n

2018-06-15 Thread Bart Van Assche
Exclude zoned block device members from struct request_queue for CONFIG_BLK_DEV_ZONED == n. Avoid breaking the build by only building the code that uses these struct request_queue members if CONFIG_BLK_DEV_ZONED != n. Signed-off-by: Bart Van Assche Reviewed-by: Damien Le Moal Cc: Matias

[PATCH 1/5] block: Remove a superfluous cast from blkdev_report_zones()

2018-06-15 Thread Bart Van Assche
No cast is necessary when assigning a non-void pointer to a void pointer. Signed-off-by: Bart Van Assche Reviewed-by: Damien Le Moal Cc: Matias Bjorling Cc: Christoph Hellwig --- block/blk-zoned.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-zoned.c b/block

[PATCH 3/5] block: Remove bdev_nr_zones()

2018-06-15 Thread Bart Van Assche
Remove this function since it has no callers. This function was introduced in commit 6cc77e9cb080 ("block: introduce zoned block devices zone write locking"). Signed-off-by: Bart Van Assche Reviewed-by: Damien Le Moal Cc: Christoph Hellwig Cc: Matias Bjorling --- include/linux/bl

[PATCH 4/5] block: Inline blk_queue_nr_zones()

2018-06-15 Thread Bart Van Assche
Since the implementation of blk_queue_nr_zones() is trivial and since it only has a single caller, inline this function. Signed-off-by: Bart Van Assche Reviewed-by: Damien Le Moal Cc: Matias Bjorling Cc: Christoph Hellwig --- block/blk-mq-debugfs.c | 2 +- include/linux/blkdev.h | 5 - 2

Re: [PATCH 0/5] Five small zoned block device patches

2018-06-16 Thread Bart Van Assche
On Sat, 2018-06-16 at 12:27 -0600, Jens Axboe wrote: > On 6/15/18 3:55 PM, Bart Van Assche wrote: > > Hello Jens, > > > > In this patch series there are five patches with small improvements for the > > zoned block device code. Please consider these patches for the upstr

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

2018-06-19 Thread Bart Van Assche
i_next not NULL in bio_endio()") Signed-off-by: Bart Van Assche Cc: Kent Overstreet Cc: Mike Snitzer --- Changes in v2 compared to v1: improved patch description. block/bio.c | 3 --- block/blk-core.c | 8 +--- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/block/bi

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

2018-06-19 Thread Bart Van Assche
On Tue, 2018-06-19 at 14:16 -0400, Kent Overstreet wrote: > I take it if we had a test for request based dm in blktests or somewhere that > probably would have caught this much easier :/ I'm working on porting the srp-test software to the blktests framework. Bart.

[PATCH 7/9] Avoid passing tests/block/002 arguments to _init_scsi_debug

2018-06-19 Thread Bart Van Assche
This patch avoids that shellcheck reports the following: tests/block/002:34:7: note: Use _init_scsi_debug "$@" if function's $1 should mean script's $1. [SC2119] Signed-off-by: Bart Van Assche --- common/scsi_debug | 3 +++ tests/block/002 | 2 +- 2 files changed

[PATCH 0/9] blktests: Re-enable shellcheck warnings

2018-06-19 Thread Bart Van Assche
series. Thanks, Bart. Bart Van Assche (9): common/rc: Fix _have_tracepoint() Annotate include statements in shell scripts where the source file is a variable check, tests/meta/012: Use array["index"] instead of array[index] Suppress shellcheck complaints about global

[PATCH 2/9] Annotate include statements in shell scripts where the source file is a variable

2018-06-19 Thread Bart Van Assche
This causes shellcheck to stop complaining about these include statements. Signed-off-by: Bart Van Assche --- check | 3 +++ 1 file changed, 3 insertions(+) diff --git a/check b/check index 4baa8dde2436..5e1ba7bc8401 100755 --- a/check +++ b/check @@ -23,6 +23,7 @@ _found_test

[PATCH 1/9] common/rc: Fix _have_tracepoint()

2018-06-19 Thread Bart Van Assche
Make sure that _have_tracepoint() uses the argument passed to that function instead of using an undefined variable. Signed-off-by: Bart Van Assche --- common/rc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/rc b/common/rc index 7f1728025364..7592400dda82 100644 --- a/common/rc

[PATCH 6/9] Multiple tests: remove unused and undefined variables

2018-06-19 Thread Bart Van Assche
Signed-off-by: Bart Van Assche Cc: Chaitanya Kulkarni --- tests/loop/003 | 3 --- tests/nvme/010 | 3 +-- tests/nvme/011 | 3 +-- tests/nvme/012 | 1 - tests/nvme/013 | 1 - 5 files changed, 2 insertions(+), 9 deletions(-) diff --git a/tests/loop/003 b/tests/loop/003 index 353d4fcfa33c

[PATCH 5/9] check: Avoid that shellcheck complains that $FULL appears unused

2018-06-19 Thread Bart Van Assche
$FULL is a global variable. Avoid that shellcheck complains about it. Signed-off-by: Bart Van Assche --- check | 2 ++ 1 file changed, 2 insertions(+) diff --git a/check b/check index 5f53fa105f72..f1feb96b293e 100755 --- a/check +++ b/check @@ -301,6 +301,8 @@ _call_test() { local

[PATCH 9/9] Makefile: Do not suppress useful shellcheck warnings

2018-06-19 Thread Bart Van Assche
). Signed-off-by: Bart Van Assche --- Makefile | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 14ba8341dae5..c4bffa2d3f32 100644 --- a/Makefile +++ b/Makefile @@ -4,21 +4,8 @@ all: clean: $(MAKE) -C src clean -# SC1090: &qu

[PATCH 3/9] check, tests/meta/012: Use array["index"] instead of array[index]

2018-06-19 Thread Bart Van Assche
This causes shellcheck to stop complaining about these array element accesses. Signed-off-by: Bart Van Assche --- check | 46 +++--- tests/meta/012 | 4 ++-- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/check b/check index

  1   2   3   4   5   6   7   8   9   10   >