Re: [PATCH 0/2][V2] io.latency test for blktests

2018-12-06 Thread Omar Sandoval
On Wed, Dec 05, 2018 at 10:34:02AM -0500, Josef Bacik wrote: > v1->v2: > - dropped my python library, TIL about jq. > - fixed the spelling mistakes in the test. > > -- Original message -- > > This patchset is to add a test to verify io.latency is working properly, and > to > add all the

Re: [PATCH] block/025: test discard sector alignement and sector size overflow

2018-12-05 Thread Omar Sandoval
On Thu, Nov 15, 2018 at 12:00:17PM +0800, Ming Lei wrote: > This test covers the following two issues: > > 1) discard sector need to be aligned with logical block size > > 2) make sure 'sector_t' instead of 'unsigned int' is used when comparing > with discard sector size > > Signed-off-by: Ming

[PATCH] sbitmap: fix sbitmap_for_each_set()

2018-12-03 Thread Omar Sandoval
From: Omar Sandoval We need to ignore bits in the cleared mask when iterating over all set bits. Fixes: ea86ea2cdced ("sbitmap: ammortize cost of clearing bits") Signed-off-by: Omar Sandoval --- include/linux/sbitmap.h | 10 ++ 1 file changed, 6 insertions(+), 4 deletion

Re: sbitmap: check cleared bits when iterating busy bits

2018-12-03 Thread Omar Sandoval
On Mon, Dec 03, 2018 at 02:56:17PM -0700, Jens Axboe wrote: > When we are iterating the set bits in a word, we also need to factor in > the cleared bits. Don't call fn() unless the bit is also not set in > the cleared word. > > Fixes: ea86ea2cdced ("sbitmap: ammortize cost of clearing bits") >

Re: [PATCH v2] blk-mq: don't call ktime_get_ns() if we don't need it

2018-12-03 Thread Omar Sandoval
On Fri, Nov 30, 2018 at 02:13:54PM -0700, Jens Axboe wrote: > We only need the request fields and the end_io time if we have > stats enabled, or if we have a scheduler attached as those may > use it for completion time stats. Reviewed-by: Omar Sandoval > Signed-off-by

Re: [PATCH 1/2] sbitmap: ammortize cost of clearing bits

2018-11-30 Thread Omar Sandoval
On Fri, Nov 30, 2018 at 01:10:47PM -0700, Jens Axboe wrote: > On 11/30/18 1:03 PM, Omar Sandoval wrote: > > On Fri, Nov 30, 2018 at 09:01:17AM -0700, Jens Axboe wrote: > >> sbitmap maintains a set of words that we use to set and clear bits, with > >> each bit represen

Re: [PATCH 2/2] sbitmap: optimize wakeup check

2018-11-30 Thread Omar Sandoval
s of sbitmap with waiting, blk-mq-tag and iSCSI. Reviewed-by: Omar Sandoval > Signed-off-by: Jens Axboe > --- > block/blk-mq-tag.c | 11 > drivers/target/iscsi/iscsi_target_util.c | 12 + > include/linux/sbitmap.h

Re: [PATCH 1/2] sbitmap: ammortize cost of clearing bits

2018-11-30 Thread Omar Sandoval
On Fri, Nov 30, 2018 at 09:01:17AM -0700, Jens Axboe wrote: > sbitmap maintains a set of words that we use to set and clear bits, with > each bit representing a tag for blk-mq. Even though we spread the bits > out and maintain a hint cache, one particular bit allocated will end up > being cleared

Re: [PATCH] sbitmap: ammortize cost of clearing bits

2018-11-29 Thread Omar Sandoval
On Thu, Nov 29, 2018 at 01:00:25PM -0700, Jens Axboe wrote: > sbitmap maintains a set of words that we use to set and clear bits, with > each bit representing a tag for blk-mq. Even though we spread the bits > out and maintain a hint cache, one particular bit allocated will end up > being cleared

Re: [PATCH] sbitmap: don't loop for find_next_zero_bit() for !round_robin

2018-11-29 Thread Omar Sandoval
On Thu, Nov 29, 2018 at 12:34:12PM -0700, Jens Axboe wrote: > If we aren't forced to do round robin tag allocation, just use the > allocation hint to find the index for the tag word, don't use it for the > offset inside the word. Maybe also add "We're already fetching that cache line, so we might

Re: [PATCH 2/8] block: improve logic around when to sort a plug list

2018-11-27 Thread Omar Sandoval
On Tue, Nov 27, 2018 at 04:59:14PM -0700, Jens Axboe wrote: > On 11/27/18 4:49 PM, Jens Axboe wrote: > > On 11/27/18 4:31 PM, Omar Sandoval wrote: > >> On Mon, Nov 26, 2018 at 09:35:50AM -0700, Jens Axboe wrote: > >>> Do it for the nr_hw_queues == 1 case, but

Re: [PATCH 2/8] block: improve logic around when to sort a plug list

2018-11-27 Thread Omar Sandoval
On Tue, Nov 27, 2018 at 04:49:27PM -0700, Jens Axboe wrote: > On 11/27/18 4:31 PM, Omar Sandoval wrote: > > On Mon, Nov 26, 2018 at 09:35:50AM -0700, Jens Axboe wrote: > >> Do it for the nr_hw_queues == 1 case, but only do it for the multi queue > >> case if we have re

Re: [PATCH 7/8] blk-mq: use bd->last == true for list inserts

2018-11-27 Thread Omar Sandoval
On Mon, Nov 26, 2018 at 09:35:55AM -0700, Jens Axboe wrote: > If we are issuing a list of requests, we know if we're at the last one. > If we fail issuing, ensure that we call ->commits_rqs() to flush any > potential previous requests. One comment below, otherwise Reviewed-by: O

Re: [PATCH 6/8] ataflop: implement mq_ops->commit_rqs() hook

2018-11-27 Thread Omar Sandoval
On Mon, Nov 26, 2018 at 09:35:54AM -0700, Jens Axboe wrote: > We need this for blk-mq to kick things into gear, if we told it that > we had more IO coming, but then failed to deliver on that promise. Who converted this one? Oh yeah, it was me... Reviewed-by: Omar Sandoval > Signed-off

Re: [PATCH 5/8] virtio_blk: implement mq_ops->commit_rqs() hook

2018-11-27 Thread Omar Sandoval
On Mon, Nov 26, 2018 at 09:35:53AM -0700, Jens Axboe wrote: > We need this for blk-mq to kick things into gear, if we told it that > we had more IO coming, but then failed to deliver on that promise. Reviewed-by: Omar Sandoval But also cc'd the virtio-blk maintainers. > Signed-off

Re: [PATCH 3/8] blk-mq: add mq_ops->commit_rqs()

2018-11-27 Thread Omar Sandoval
responsible for flushing pending requests, if it uses bd->last to > optimize that part. This works like before, no changes there. Reviewed-by: Omar Sandoval > Signed-off-by: Jens Axboe > --- > include/linux/blk-mq.h | 10 ++ > 1 file changed, 10 insertions(+) > >

Re: [PATCH 2/8] block: improve logic around when to sort a plug list

2018-11-27 Thread Omar Sandoval
On Mon, Nov 26, 2018 at 09:35:50AM -0700, Jens Axboe wrote: > Do it for the nr_hw_queues == 1 case, but only do it for the multi queue > case if we have requests for multiple devices in the plug. > > Signed-off-by: Jens Axboe > --- > block/blk-core.c | 1 + > block/blk-mq.c | 7

Re: [PATCH] block/025: test discard sector alignement and sector size overflow

2018-11-26 Thread Omar Sandoval
On Thu, Nov 15, 2018 at 12:00:17PM +0800, Ming Lei wrote: > This test covers the following two issues: > > 1) discard sector need to be aligned with logical block size > > 2) make sure 'sector_t' instead of 'unsigned int' is used when comparing > with discard sector size > > Signed-off-by: Ming

Re: [PATCH blktests] Add use of logger so that syslog files show when each test starts

2018-11-26 Thread Omar Sandoval
On Mon, Nov 26, 2018 at 02:31:29PM -0500, Theodore Y. Ts'o wrote: > On Mon, Nov 26, 2018 at 10:37:23AM -0800, Omar Sandoval wrote: > > > > Hm, what if we output it as KERN_INFO? > > > > diff --git a/check b/check > > index f6c3537..9b4765f 100755 > > --

Re: [PATCH blktests] Add use of logger so that syslog files show when each test starts

2018-11-26 Thread Omar Sandoval
On Mon, Nov 26, 2018 at 01:32:11PM -0500, Theodore Y. Ts'o wrote: > On Mon, Nov 26, 2018 at 09:50:57AM -0800, Omar Sandoval wrote: > > > > Hey, Ted, sorry, I meant to ask you about this in person at LPC but > > forgot to. Forgive my ignorance about syslog, but does syslog not

Re: [PATCH blktests] Add use of logger so that syslog files show when each test starts

2018-11-26 Thread Omar Sandoval
On Thu, Nov 22, 2018 at 08:02:21PM -0500, Theodore Y. Ts'o wrote: > Ping? > > - Ted > > On Mon, Oct 29, 2018 at 12:15:57PM -0400, Theodore Ts'o wrote: > > Signed-off-by: Theodore Ts'o > > --- > > check | 3 +++ > > 1

Re: [PATCH 6/6] mmc: stop abusing the request queue_lock pointer

2018-11-16 Thread Omar Sandoval
On Fri, Nov 16, 2018 at 09:10:06AM +0100, Christoph Hellwig wrote: > Replace the lock in mmc_blk_data that is only used through a pointer > in struct mmc_queue and to protect fields in that structure with > an actual lock in struct mmc_queue. Looks sane to me, but I'll let the mmc people ack. >

Re: [PATCH] block: fix 32 bit overflow in __blkdev_issue_discard()

2018-11-16 Thread Omar Sandoval
On Fri, Nov 16, 2018 at 12:32:33AM -0800, Christoph Hellwig wrote: > On Fri, Nov 16, 2018 at 03:04:57PM +1100, Dave Chinner wrote: > > They don't run on my test machines because they require a modular > > kernel and I run a monolithic kernel specified externally by the > > qemu command line on all

Re: [PATCH 5/6] ide: don't acquire queue_lock in ide_complete_pm_rq

2018-11-16 Thread Omar Sandoval
On Fri, Nov 16, 2018 at 09:40:04AM +0100, Christoph Hellwig wrote: > On Fri, Nov 16, 2018 at 12:37:32AM -0800, Omar Sandoval wrote: > > On Fri, Nov 16, 2018 at 09:10:05AM +0100, Christoph Hellwig wrote: > > > blk_mq_stop_hw_queues doesn't need any locking, and the ide > >

Re: [PATCH 5/6] ide: don't acquire queue_lock in ide_complete_pm_rq

2018-11-16 Thread Omar Sandoval
On Fri, Nov 16, 2018 at 09:10:05AM +0100, Christoph Hellwig wrote: > blk_mq_stop_hw_queues doesn't need any locking, and the ide > dev_flags field isn't protected by it either. Is it a bug that dev_flags is no longer protected by queue_lock after the mq conversion? > Signed-off-by: Christoph

Re: [PATCH 4/6] ide: don't acquire queue lock in ide_pm_execute_rq

2018-11-16 Thread Omar Sandoval
On Fri, Nov 16, 2018 at 09:10:04AM +0100, Christoph Hellwig wrote: > There is nothing we can synchronize against over a call to > blk_queue_dying. Reviewed-by: Omar Sandoval > Signed-off-by: Christoph Hellwig > --- > drivers/ide/ide-pm.c | 3 --- > 1 file changed, 3 dele

Re: [PATCH 3/6] pktcdvd: remove queue_lock around blk_queue_max_hw_sectors

2018-11-16 Thread Omar Sandoval
On Fri, Nov 16, 2018 at 09:10:03AM +0100, Christoph Hellwig wrote: > blk_queue_max_hw_sectors can't do anything with queue_lock protection > so don't hold it. Reviewed-by: Omar Sandoval > Signed-off-by: Christoph Hellwig > --- > drivers/block/pktcdvd.c | 2 -- > 1 file ch

Re: [PATCH 2/6] floppy: remove queue_lock around floppy_end_request

2018-11-16 Thread Omar Sandoval
On Fri, Nov 16, 2018 at 09:10:02AM +0100, Christoph Hellwig wrote: > There is nothing the queue_lock could protect inside floppy_end_request, > so remove it. Reviewed-by: Omar Sandoval > Signed-off-by: Christoph Hellwig > --- > drivers/block/floppy.c | 5 - > 1 file ch

Re: [PATCH 1/6] block: remove the rq_alloc_data request_queue field

2018-11-16 Thread Omar Sandoval
On Fri, Nov 16, 2018 at 09:10:01AM +0100, Christoph Hellwig wrote: Reviewed-by: Omar Sandoval > Signed-off-by: Christoph Hellwig > --- > include/linux/blkdev.h | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h &g

Re: "kyber: add tracepoints" causes write beyond size of object

2018-11-14 Thread Omar Sandoval
On Wed, Nov 14, 2018 at 05:23:06PM -0600, Kees Cook wrote: > On Sat, Nov 10, 2018 at 8:15 AM, Jordan Glover > wrote: > > Hello, > > > > Commit 6c3b7af1c975b87b86dcb2af233d1ae21eb05107 ("kyber: add > > tracepoints")[1] causes write beyond size of object. This was detected by > > "FORTIFY_SOURCE

Re: [PATCH v2] makefile: Add install rule

2018-11-14 Thread Omar Sandoval
On Wed, Nov 14, 2018 at 11:39:31AM -0800, Gwendal Grignou wrote: > Add rule to install to a target directory, /usr/local/blktests by > default. > > Signed-off-by: Gwendal Grignou Pushed with a slightly expanded description in the README. Thanks!

Re: [PATCH blktests] makefile: Add install rule

2018-11-14 Thread Omar Sandoval
On Fri, Nov 09, 2018 at 07:15:24AM -0800, Gwendal Grignou wrote: > Add rule to install to a target directory, /usr/local/blktests by > default. This seems reasonale, but I'm curious, what's your use case? > Signed-off-by: Gwendal Grignou > --- > Makefile | 9 + > src/Makefile | 3

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

2018-11-12 Thread Omar Sandoval
From: Omar Sandoval When copying to the latency type, we should be passing LATENCY_TYPE_LEN, not DOMAIN_LEN (this isn't a problem in practice because we only pass "total" or "I/O"). Fix it by changing all of the strlcpy() calls to use sizeof(). Fixes: 6c3b7af1c975 (&qu

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

2018-11-11 Thread Omar Sandoval
On Sun, Nov 11, 2018 at 09:25:27AM -0800, Omar Sandoval wrote: > From: Omar Sandoval > > When copying to the latency type, we should be passing LATENCY_TYPE_LEN, > not DOMAIN_LEN. This isn't a problem in practice because we only pass > "total" or "I/O", but

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

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

Re: [PATCH] floppy: fix race condition in __floppy_read_block_0()

2018-11-09 Thread Omar Sandoval
nit. If it does, we are passing garbage to > complete() and we may sleep forever waiting for the event to > occur. > > Fixes: 7b7b68bba5ef ("floppy: bail out in open() if drive is not responding > to block0 read") Reviewed-by: Omar Sandoval > Signed-off-by: Jens Axb

Re: [PATCH 0/2] blktests: New loop tests

2018-10-25 Thread Omar Sandoval
On Thu, Oct 18, 2018 at 12:31:45PM +0200, Jan Kara wrote: > > Hello, > > these two patches create two new tests for blktests as regression tests > for my recently posted loopback device fixes. More details in individual > patches. Thanks, Jan, I applied 007 renamed to 006.

Re: [PATCH v2] blktest: remove instances of null_blk queue_mode=1

2018-10-25 Thread Omar Sandoval
On Thu, Oct 25, 2018 at 03:03:30PM -0600, Jens Axboe wrote: > This is no longer supported in recent kernels, get rid of > any testing of queue_mode=1. queue_mode=1 tested the legacy > IO path, which is going away completely. As such, there's > no point in doing anymore testing with it. > >

Re: [PATCH 1/2] loop/006: Add test for setting partscan flag

2018-10-23 Thread Omar Sandoval
On Tue, Oct 23, 2018 at 12:05:12PM +0200, Jan Kara wrote: > On Mon 22-10-18 15:52:55, Omar Sandoval wrote: > > On Thu, Oct 18, 2018 at 12:31:46PM +0200, Jan Kara wrote: > > > Add test for setting partscan flag. > > > > > > Signed-off-by: Jan Kara > &g

Re: [PATCH blktests] common/rc: allow the loop driver to be built into the kernel

2018-10-23 Thread Omar Sandoval
On Tue, Oct 23, 2018 at 08:56:24AM -0400, Theodore Y. Ts'o wrote: > On Mon, Oct 22, 2018 at 04:08:30PM -0700, Omar Sandoval wrote: > > On Mon, Oct 22, 2018 at 06:50:04AM -0400, Theodore Ts'o wrote: > > > A number of kernel modules used by blktests must be compiled as &g

Re: [PATCH blktests] common/rc: allow the loop driver to be built into the kernel

2018-10-22 Thread Omar Sandoval
On Mon, Oct 22, 2018 at 06:50:04AM -0400, Theodore Ts'o wrote: > A number of kernel modules used by blktests must be compiled as > modules, since the module needs to be loaded with specific options, or > part of the test is to exercise what what happens when the kernel > module is loaded. This is

Re: [PATCH 2/2] loop/007: Add test for oops during backing file verification

2018-10-22 Thread Omar Sandoval
On Thu, Oct 18, 2018 at 12:31:47PM +0200, Jan Kara wrote: > Add regression test for patch "block/loop: Use global lock for ioctl() > operation." where we can oops while traversing list of loop devices > backing newly created device. > > Signed-off-by: Jan Kara Looks good, sans a missing

Re: [PATCH 1/2] loop/006: Add test for setting partscan flag

2018-10-22 Thread Omar Sandoval
On Thu, Oct 18, 2018 at 12:31:46PM +0200, Jan Kara wrote: > Add test for setting partscan flag. > > Signed-off-by: Jan Kara Sorry I didn't notice this earlier, but loop/001 already does a partition rescan (via losetup -P). Does that cover this test case? > --- > src/Makefile

Re: [PATCH 0/15 v2] loop: Fix oops and possible deadlocks

2018-10-16 Thread Omar Sandoval
On Tue, Oct 16, 2018 at 01:36:54PM +0200, Jan Kara wrote: > On Wed 10-10-18 14:28:09, Jan Kara wrote: > > On Wed 10-10-18 13:42:27, Johannes Thumshirn wrote: > > > On Wed, Oct 10, 2018 at 07:19:00PM +0900, Tetsuo Handa wrote: > > > > On 2018/10/10 19:04, Jan Kara wrote: > > > > > Hi, > > > > > >

Re: [PATCH v2 00/11] Convert floppy drivers to blk-mq

2018-10-15 Thread Omar Sandoval
On Sun, Oct 14, 2018 at 12:12:24PM +1100, Finn Thain wrote: > On Thu, 11 Oct 2018, Omar Sandoval wrote: > > > From: Omar Sandoval > > > > Hi, > > > > This series converts the various floppy drivers to blk-mq. Save for the > > last one (floppy), the

[PATCH v2 07/11] amiflop: convert to blk-mq

2018-10-11 Thread Omar Sandoval
From: Omar Sandoval Straightforward conversion, just use the existing amiflop_lock to serialize access to the controller. Compile-tested only. Cc: Laurent Vivier Signed-off-by: Omar Sandoval --- drivers/block/amiflop.c | 125 +++- 1 file changed, 46

[PATCH v2 08/11] ataflop: fold headers into C file

2018-10-11 Thread Omar Sandoval
From: Omar Sandoval atafd.h and atafdreg.h are only used from ataflop.c, so merge them in there. Signed-off-by: Omar Sandoval --- arch/m68k/include/asm/atafd.h| 13 - arch/m68k/include/asm/atafdreg.h | 80 -- drivers/block/ataflop.c | 83

[PATCH v2 09/11] ataflop: fix error handling during setup

2018-10-11 Thread Omar Sandoval
From: Omar Sandoval Move queue allocation next to disk allocation to fix a couple of issues: - If add_disk() hasn't been called, we should clear disk->queue before calling put_disk(). - If we fail to allocate a request queue, we still need to put all of the disks, not just the ones that

[PATCH v2 06/11] amiflop: clean up on errors during setup

2018-10-11 Thread Omar Sandoval
From: Omar Sandoval The error handling in fd_probe_drives() doesn't clean up at all. Fix it up in preparation for converting to blk-mq. While we're here, get rid of the commented out amiga_floppy_remove(). Signed-off-by: Omar Sandoval --- drivers/block/amiflop.c | 84

[PATCH v2 10/11] ataflop: convert to blk-mq

2018-10-11 Thread Omar Sandoval
From: Omar Sandoval This driver is already pretty broken, in that it has two wait_events() (one in stdma_lock()) in request_fn. Get rid of the first one by freezing/quiescing the queue on format, and the second one by replacing it with stdma_try_lock(). The rest is straightforward. Compile

[PATCH v2 04/11] swim3: convert to blk-mq

2018-10-11 Thread Omar Sandoval
From: Omar Sandoval Pretty simple conversion. grab_drive() could probably be replaced by some freeze/quiesce incantation, but I left it alone, and just used freeze/quiesce for eject. Compile-tested only. Cc: Benjamin Herrenschmidt Signed-off-by: Omar Sandoval --- drivers/block/swim3.c | 163

[PATCH v2 02/11] swim: convert to blk-mq

2018-10-11 Thread Omar Sandoval
From: Omar Sandoval The only interesting thing here is that there may be two floppies (i.e., request queues) sharing the same controller, so we use the global struct swim_priv->lock to check whether the controller is busy. Compile-tested only. Cc: Finn Thain Cc: Laurent Vivier Signed-

[PATCH v2 03/11] swim3: add real error handling in setup

2018-10-11 Thread Omar Sandoval
From: Omar Sandoval The driver doesn't have support for removing a device that has already been configured, but with more careful ordering we can avoid the need for that and make sure that we don't leak generic resources. Signed-off-by: Omar Sandoval --- drivers/block/swim3.c | 60

[PATCH v2 05/11] amiflop: fold headers into C file

2018-10-11 Thread Omar Sandoval
From: Omar Sandoval amifd.h and amifdreg.h are only used from amiflop.c, and they're pretty small, so move the contents to amiflop.c and get rid of the .h files. This is preparation for adding a struct blk_mq_tag_set to struct amiga_floppy_struct. Signed-off-by: Omar Sandoval --- drivers

[PATCH v2 11/11] floppy: convert to blk-mq

2018-10-11 Thread Omar Sandoval
From: Omar Sandoval This driver likes to fetch requests from all over the place, so make queue_rq put requests on a list so that the logic stays the same. Tested with QEMU. Signed-off-by: Omar Sandoval --- drivers/block/floppy.c | 74 +- 1 file changed

[PATCH v2 00/11] Convert floppy drivers to blk-mq

2018-10-11 Thread Omar Sandoval
From: Omar Sandoval Hi, This series converts the various floppy drivers to blk-mq. Save for the last one (floppy), they're compile-tested only. If I've Cc'd you, it's because I think you might be able to test the changes. Please test if you can, or let me know if there's a way to use QEMU/some

[PATCH v2 01/11] swim: fix cleanup on setup error

2018-10-11 Thread Omar Sandoval
From: Omar Sandoval If we fail to allocate the request queue for a disk, we still need to free that disk, not just the previous ones. Additionally, we need to cleanup the previous request queues. Signed-off-by: Omar Sandoval --- drivers/block/swim.c | 13 +++-- 1 file changed, 11

Re: [PATCH 12/13] floppy: end whole request on error

2018-10-11 Thread Omar Sandoval
On Thu, Oct 11, 2018 at 12:39:51PM -0600, Jens Axboe wrote: > On 10/11/18 12:30 PM, Omar Sandoval wrote: > > From: Omar Sandoval > > > > If floppy_end_request() gets passed an error, it should end the whole > > request, not just the current segment. > > I don't

[PATCH 06/13] amiflop: fold headers into C file

2018-10-11 Thread Omar Sandoval
From: Omar Sandoval amifd.h and amifdreg.h are only used from amiflop.c, and they're pretty small, so move the contents to amiflop.c and get rid of the .h files. This is preparation for adding a struct blk_mq_tag_set to struct amiga_floppy_struct. Signed-off-by: Omar Sandoval --- drivers

[PATCH 08/13] amiflop: convert to blk-mq

2018-10-11 Thread Omar Sandoval
From: Omar Sandoval Straightforward conversion, just use the existing amiflop_lock to serialize access to the controller. Compile-tested only. Cc: Laurent Vivier Signed-off-by: Omar Sandoval --- drivers/block/amiflop.c | 127 +++- 1 file changed, 48

[PATCH 05/13] swim3: convert to blk-mq

2018-10-11 Thread Omar Sandoval
From: Omar Sandoval Pretty simple conversion. To avoid extra churn, we keep the swim3_end_request() wrapper. grab_drive() could probably be replaced by some freeze/quiesce incantation, but I left it alone, and just used freeze/quiesce for eject. Compile-tested only. Cc: Benjamin Herrenschmidt

[PATCH 07/13] amiflop: clean up on errors during setup

2018-10-11 Thread Omar Sandoval
From: Omar Sandoval The error handling in fd_probe_drives() doesn't clean up at all. Fix it up in preparation for converting to blk-mq. While we're here, get rid of the commented out amiga_floppy_remove(). Signed-off-by: Omar Sandoval --- drivers/block/amiflop.c | 84

[PATCH 13/13] floppy: convert to blk-mq

2018-10-11 Thread Omar Sandoval
From: Omar Sandoval This driver likes to fetch requests from all over the place, so make queue_rq put requests on a list so that the logic stays the same. Tested with QEMU. Signed-off-by: Omar Sandoval --- drivers/block/floppy.c | 74 +- 1 file changed

[PATCH 10/13] ataflop: fix error handling during setup

2018-10-11 Thread Omar Sandoval
From: Omar Sandoval Move queue allocation next to disk allocation to fix a couple of issues: - If add_disk() hasn't been called, we should clear disk->queue before calling put_disk(). - If we fail to allocate a request queue, we still need to put all of the disks, not just the ones that

[PATCH 11/13] ataflop: convert to blk-mq

2018-10-11 Thread Omar Sandoval
From: Omar Sandoval This driver is already pretty broken, in that it has two wait_events() (one in stdma_lock()) in request_fn. Get rid of the first one by freezing/quiescing the queue on format, and the second one by replacing it with stdma_try_lock(). The rest is straightforward. Compile

[PATCH 09/13] ataflop: fold headers into C file

2018-10-11 Thread Omar Sandoval
From: Omar Sandoval atafd.h and atafdreg.h are only used from ataflop.c, so merge them in there. Signed-off-by: Omar Sandoval --- arch/m68k/include/asm/atafd.h| 13 - arch/m68k/include/asm/atafdreg.h | 80 -- drivers/block/ataflop.c | 83

[PATCH 12/13] floppy: end whole request on error

2018-10-11 Thread Omar Sandoval
From: Omar Sandoval If floppy_end_request() gets passed an error, it should end the whole request, not just the current segment. Signed-off-by: Omar Sandoval --- drivers/block/floppy.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/block/floppy.c b/drivers

[PATCH 04/13] swim3: end whole request on error

2018-10-11 Thread Omar Sandoval
From: Omar Sandoval When swim3_end_request() gets passed an error, it seems that the intent is to end the whole request, but we're only ending the current segment. Signed-off-by: Omar Sandoval --- drivers/block/swim3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 03/13] swim3: add real error handling in setup

2018-10-11 Thread Omar Sandoval
From: Omar Sandoval The driver doesn't have support for removing a device that has already been configured, but with more careful ordering we can avoid the need for that and make sure that we don't leak generic resources. Signed-off-by: Omar Sandoval --- drivers/block/swim3.c | 60

[PATCH 02/13] swim: convert to blk-mq

2018-10-11 Thread Omar Sandoval
From: Omar Sandoval The only interesting thing here is that there may be two floppies (i.e., request queues) sharing the same controller, so we use the global struct swim_priv->lock to check whether the controller is busy. Compile-tested only. Cc: Finn Thain Cc: Laurent Vivier Signed-

[PATCH 00/13] Convert floppy drivers to blk-mq

2018-10-11 Thread Omar Sandoval
From: Omar Sandoval Hi, This series converts the various floppy drivers to blk-mq. Save for the last one (floppy), they're compile-tested only. If I've Cc'd you, it's because I think you might be able to test the changes. Please test if you can, or let me know if there's a way to use QEMU/some

[PATCH 01/13] swim: fix cleanup on setup error

2018-10-11 Thread Omar Sandoval
From: Omar Sandoval If we fail to allocate the request queue for a disk, we still need to free that disk, not just the previous ones. Additionally, we need to cleanup the previous request queues. Signed-off-by: Omar Sandoval --- drivers/block/swim.c | 13 +++-- 1 file changed, 11

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

2018-10-05 Thread Omar Sandoval
On Fri, Oct 05, 2018 at 08:18:00AM -0600, Jens Axboe wrote: > On 10/4/18 11:35 AM, Bart Van Assche wrote: > > 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. > >

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

2018-10-05 Thread Omar Sandoval
On Thu, Sep 27, 2018 at 04:26:42PM -0700, Bart Van Assche wrote: > On Tue, 2018-09-18 at 17:18 -0700, Omar Sandoval wrote: > > On Tue, Sep 18, 2018 at 05:02:47PM -0700, Bart Van Assche wrote: > > > On 9/18/18 4:24 PM, Omar Sandoval wrote: > > > > On Tue, Sep 18, 2018

[PATCH] kyber: fix integer overflow of latency targets on 32-bit

2018-09-28 Thread Omar Sandoval
From: Omar Sandoval NSEC_PER_SEC has type long, so 5 * NSEC_PER_SEC is calculated as a long. However, 5 seconds is 5,000,000,000 nanoseconds, which overflows a 32-bit long. Make sure all of the targets are calculated as 64-bit values. Fixes: 6e25cb01ea20 ("kyber: implement improved heuri

[PATCH v2 0/5] kyber: better heuristics

2018-09-27 Thread Omar Sandoval
From: Omar Sandoval Hi, This is my series to improve the heuristics used by Kyber. Patches 1 and 2 are preparation. Patch 3 is a minor optimization. Patch 4 is the main change, and includes a detailed description of the new heuristics. Patch 5 adds tracepoints for debugging. This is basically

[PATCH v2 1/5] block: move call of scheduler's ->completed_request() hook

2018-09-27 Thread Omar Sandoval
From: Omar Sandoval Commit 4bc6339a583c ("block: move blk_stat_add() to __blk_mq_end_request()") consolidated some calls using ktime_get() so we'd only need to call it once. Kyber's ->completed_request() hook also calls ktime_get(), so let's move it to the same place, too. Signed

[PATCH v2 2/5] block: export blk_stat_enable_accounting()

2018-09-27 Thread Omar Sandoval
From: Omar Sandoval Kyber will need this in a future change if it is built as a module. Signed-off-by: Omar Sandoval --- block/blk-stat.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/blk-stat.c b/block/blk-stat.c index 7587b1c3caaf..90561af85a62 100644 --- a/block/blk-stat.c

[PATCH v2 5/5] kyber: add tracepoints

2018-09-27 Thread Omar Sandoval
From: Omar Sandoval When debugging Kyber, it's really useful to know what latencies we've been having, how the domain depths have been adjusted, and if we've actually been throttling. Add three tracepoints, kyber_latency, kyber_adjust, and kyber_throttled, to record that. Signed-off-by: Omar

[PATCH v2 4/5] kyber: implement improved heuristics

2018-09-27 Thread Omar Sandoval
From: Omar Sandoval Kyber's current heuristics have a few flaws: - It's based on the mean latency, but p99 latency tends to be more meaningful to anyone who cares about latency. The mean can also be skewed by rare outliers that the scheduler can't do anything about. - The statistics

[PATCH v2 3/5] kyber: don't make domain token sbitmap larger than necessary

2018-09-27 Thread Omar Sandoval
From: Omar Sandoval The domain token sbitmaps are currently initialized to the device queue depth or 256, whichever is larger, and immediately resized to the maximum depth for that domain (256, 128, or 64 for read, write, and other, respectively). The sbitmap is never resized larger than

Re: [PATCH] blk-mq: I/O and timer unplugs are inverted in blktrace

2018-09-27 Thread Omar Sandoval
ed in blk-mq since 4.11. > > Cc: sta...@vger.kernel.org > Fixes: bd166ef183c2 ("blk-mq-sched: add framework for MQ capable IO > schedulers") Reviewed-by: Omar Sandoval > Signed-off-by: Ilya Dryomov > --- > block/blk-mq.c | 4 ++-- > 1 file changed, 2 inserti

Re: [PATCH 1/4] block/loop: Don't grab "struct file" for vfs_getattr() operation.

2018-09-25 Thread Omar Sandoval
On Wed, Sep 26, 2018 at 12:26:46AM +0900, Tetsuo Handa wrote: > vfs_getattr() needs "struct path" rather than "struct file". > Let's use path_get()/path_put() rather than get_file()/fput(). Reviewed-by: Omar Sandoval > Signed-off-by: Tetsuo Handa > Reviewed-by:

Re: [PATCH] block: use nanosecond resolution for iostat

2018-09-24 Thread Omar Sandoval
On Fri, Sep 21, 2018 at 08:27:17PM -0600, Jens Axboe wrote: > On 9/21/18 5:44 PM, Omar Sandoval wrote: > > From: Omar Sandoval > > > > Klaus Kusche reported that the I/O busy time in /proc/diskstats was not > > updating properly on 4.18. This is because we start

[PATCH] block: use nanosecond resolution for iostat

2018-09-21 Thread Omar Sandoval
From: Omar Sandoval Klaus Kusche reported that the I/O busy time in /proc/diskstats was not updating properly on 4.18. This is because we started using ktime to track elapsed time, and we convert nanoseconds to jiffies when we update the partition counter. However, this gets rounded down, so any

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

2018-09-18 Thread Omar Sandoval
On Tue, Sep 18, 2018 at 05:02:47PM -0700, Bart Van Assche wrote: > On 9/18/18 4:24 PM, Omar Sandoval wrote: > > On Tue, Sep 18, 2018 at 02:20:59PM -0700, Bart Van Assche wrote: > > > Can you have a look at the updated master branch of > > > https://github.com/bvanassche

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

2018-09-18 Thread Omar Sandoval
On Tue, Sep 18, 2018 at 02:20:59PM -0700, Bart Van Assche wrote: > On 8/23/18 5:21 PM, Omar Sandoval wrote: > > On Thu, Aug 23, 2018 at 01:53:33AM +, Bart Van Assche wrote: > > > On Tue, 2018-08-21 at 08:46 +0200, Johannes Thumshirn wrote: > > > > On Mon, Aug 20,

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

2018-09-12 Thread Omar Sandoval
On Thu, Aug 23, 2018 at 05:21:33PM -0700, Omar Sandoval wrote: > On Thu, Aug 23, 2018 at 01:53:33AM +, Bart Van Assche wrote: > > On Tue, 2018-08-21 at 08:46 +0200, Johannes Thumshirn wrote: > > > On Mon, Aug 20, 2018 at 03:46:45PM +, Bart Van Assche wrote: > >

Re: [PATCH] null_blk: fix zoned support for non-rq based operation

2018-09-12 Thread Omar Sandoval
11948 ("null_blk: add zone support") I just added block/023 to blktests for this, so Tested-by: Omar Sandoval > Signed-off-by: Jens Axboe > > --- > > diff --git a/drivers/block/null_blk.h b/drivers/block/null_blk.h > index d81781f22dba..34e0030f0592 10064

Re: [PATCH] blktests: remove unused null_blk parameter for _init_null_blk in block/016

2018-08-28 Thread Omar Sandoval
On Sat, Aug 25, 2018 at 06:06:19PM +0800, Yi Zhang wrote: > Signed-off-by: Yi Zhang > --- > tests/block/016 | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tests/block/016 b/tests/block/016 > index 0e6f2e1..e0a63ad 100755 > --- a/tests/block/016 > +++ b/tests/block/016

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

2018-08-23 Thread Omar Sandoval
On Thu, Aug 23, 2018 at 01:53:33AM +, Bart Van Assche wrote: > On Tue, 2018-08-21 at 08:46 +0200, Johannes Thumshirn wrote: > > On Mon, Aug 20, 2018 at 03:46:45PM +, Bart Van Assche wrote: > > > Moving these tests into the nvme directory is possible but will make it > > > harder to run the

Re: [PATCH] block: remove duplicate initialization

2018-08-17 Thread Omar Sandoval
esent in struct request_queue. Reviewed-by: Omar Sandoval > Signed-off-by: Chaitanya Kulkarni > --- > block/blk-core.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/block/blk-core.c b/block/blk-core.c > index 21c7cb35d3b4..dee56c282efb 100644 > --- a/block/blk-core.

Re: [RFC PATCH 1/5] block: move call of scheduler's ->completed_request() hook

2018-08-10 Thread Omar Sandoval
On Fri, Aug 10, 2018 at 10:59:37AM +0800, jianchao.wang wrote: > Hi Omar > > On 08/10/2018 04:26 AM, Omar Sandoval wrote: > > @@ -524,6 +524,9 @@ inline void __blk_mq_end_request(struct request *rq, > > blk_status_t error) > > blk_stat_add(rq, now); >

[RFC PATCH 4/5] kyber: implement improved heuristics

2018-08-09 Thread Omar Sandoval
From: Omar Sandoval Kyber's current heuristics have a few flaws: - It's based on the mean latency, but p99 latency tends to be more meaningful to anyone who cares about latency. The mean can also be skewed by rare outliers that the scheduler can't do anything about. - The statistics

[RFC PATCH 5/5] kyber: add tracepoints

2018-08-09 Thread Omar Sandoval
From: Omar Sandoval When debugging Kyber, it's really useful to know what latencies we've been having and how the domain depths have been adjusted. Add two tracepoints, kyber_latency and kyber_adjust, to record that. Signed-off-by: Omar Sandoval --- block/kyber-iosched.c| 46

[RFC PATCH 3/5] kyber: don't make domain token sbitmap larger than necessary

2018-08-09 Thread Omar Sandoval
From: Omar Sandoval The domain token sbitmaps are currently initialized to the device queue depth or 256, whichever is larger, and immediately resized to the maximum depth for that domain (256, 128, or 64 for read, write, and other, respectively). The sbitmap is never resized larger than

[RFC PATCH 1/5] block: move call of scheduler's ->completed_request() hook

2018-08-09 Thread Omar Sandoval
From: Omar Sandoval Commit 4bc6339a583c ("block: move blk_stat_add() to __blk_mq_end_request()") consolidated some calls using ktime_get() so we'd only need to call it once. Kyber's ->completed_request() hook also calls ktime_get(), so let's move it to the same place, too. Signed

[RFC PATCH 0/5] kyber: better heuristics

2018-08-09 Thread Omar Sandoval
From: Omar Sandoval Hello, I've spent the past few weeks experimenting with different heuristics for Kyber in order to deal with some edge cases we've hit here. This series is my progress so far, implementing less handwavy heuristics while keeping the same basic mechanisms. Patches 1 and 2

[RFC PATCH 2/5] block: export blk_stat_enable_accounting()

2018-08-09 Thread Omar Sandoval
From: Omar Sandoval Kyber will need this in a future change if it is built as a module. Signed-off-by: Omar Sandoval --- block/blk-stat.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/blk-stat.c b/block/blk-stat.c index 175c143ac5b9..d98f3ad6794e 100644 --- a/block/blk-stat.c

Re: [PATCH 0/2] blktests: test ANA base support

2018-07-26 Thread Omar Sandoval
On Thu, Jul 26, 2018 at 02:31:32PM -0700, Omar Sandoval wrote: > On Thu, Jul 26, 2018 at 09:35:53AM -0700, James Smart wrote: > > make sure this fix has been picked up in your kernel: > > http://git.infradead.org/nvme.git/commit/6cdefc6e2ad52170f89a8d0e8b1a1339f91834dc > > &g

  1   2   3   4   5   6   7   >