[PATCH 0/2] loop: LOOP_FLAGS_BLOCKSIZE fixes

2017-08-18 Thread Omar Sandoval
From: Omar Sandoval <osan...@fb.com> A couple of bugs I found while adding blktests for the new loop block size feature. Based on v4.13-rc5, we should get these in for 4.13. Thanks! Omar Sandoval (2): loop: always return block size in LOOP_GET_STATUS loop: fix hang if LOOP_SET_STATU

Re: [PATCH] blk-mq-pci: add a fallback when pci_irq_get_affinity returns NULL

2017-08-17 Thread Omar Sandoval
e. Reviewed-by: Omar Sandoval <osan...@fb.com> Has nvme been fixed to not crash if blk_mq_alloc_tag_set() fails? > Signed-off-by: Christoph Hellwig <h...@lst.de> > Cc: sta...@vger.kernel.org > --- > block/blk-mq-pci.c | 8 +++- > 1 file changed, 7 insertions(+), 1 del

Re: [PATCH 5/6] blk-mq: enable checking two part inflight counts at the same time

2017-08-09 Thread Omar Sandoval
On Tue, Aug 08, 2017 at 05:47:15PM -0600, Jens Axboe wrote: > On 08/08/2017 04:48 PM, Omar Sandoval wrote: > > On Fri, Aug 04, 2017 at 09:04:21AM -0600, Jens Axboe wrote: > >> Modify blk_mq_in_flight() to count both a partition and root at > >> the same time. Then w

Re: [PATCH V2 01/20] blk-mq-sched: fix scheduler bad performance

2017-08-09 Thread Omar Sandoval
On Wed, Aug 09, 2017 at 10:32:52AM +0800, Ming Lei wrote: > On Wed, Aug 9, 2017 at 8:11 AM, Omar Sandoval <osan...@osandov.com> wrote: > > On Sat, Aug 05, 2017 at 02:56:46PM +0800, Ming Lei wrote: > >> When hw queue is busy, we shouldn't take requests from > >> sc

Re: [PATCH V2 01/20] blk-mq-sched: fix scheduler bad performance

2017-08-08 Thread Omar Sandoval
On Sat, Aug 05, 2017 at 02:56:46PM +0800, Ming Lei wrote: > When hw queue is busy, we shouldn't take requests from > scheduler queue any more, otherwise IO merge will be > difficult to do. > > This patch fixes the awful IO performance on some > SCSI devices(lpfc, qla2xxx, ...) when

Re: [PATCH 4/6] blk-mq: provide internal in-flight variant

2017-08-08 Thread Omar Sandoval
.vanass...@wdc.com> Barring performance numbers that show that percpu is much better (which I doubt), Reviewed-by: Omar Sandoval <osan...@fb.com> > Signed-off-by: Jens Axboe <ax...@kernel.dk> > --- > block/blk-mq.c| 31 +++ > block/blk-mq.h

Re: [PATCH 3/6] block: make part_in_flight() take an array of two ints

2017-08-08 Thread Omar Sandoval
nfligh count, if the partition passed in is not the > root. > > This is in preparation for being able to calculate both in one > go. One tiny comment below, besides that Reviewed-by: Omar Sandoval <osan...@fb.com> > Signed-off-by: Jens Axboe <ax...@kernel.dk> > diff --git a/inc

Re: [PATCH 5/6] blk-mq: enable checking two part inflight counts at the same time

2017-08-08 Thread Omar Sandoval
On Fri, Aug 04, 2017 at 09:04:21AM -0600, Jens Axboe wrote: > Modify blk_mq_in_flight() to count both a partition and root at > the same time. Then we only have to call it once, instead of > potentially looping the tags twice. Reviewed-by: Omar Sandoval <osan...@fb.com> On

Re: [PATCH 2/6] block: pass in queue to inflight accounting

2017-08-08 Thread Omar Sandoval
ass...@wdc.com> Reviewed-by: Omar Sandoval <osan...@fb.com>

Re: [PATCH 1/6] blk-mq-tag: check for NULL rq when iterating tags

2017-08-08 Thread Omar Sandoval
signed the tags->rqs[] array position yet. > > This is perfectly safe, since the memory backing of the request is > never going away while the device is alive. Reviewed-by: Omar Sandoval <osan...@fb.com> > Signed-off-by: Jens Axboe <ax...@kernel.dk>

Re: [PATCH 0/5] block: a virtual block device driver for testing

2017-08-08 Thread Omar Sandoval
On Tue, Aug 08, 2017 at 10:00:21PM +, Bart Van Assche wrote: > On Tue, 2017-08-08 at 15:13 -0600, Jens Axboe wrote: > > On 08/08/2017 03:05 PM, Shaohua Li wrote: > > > > I'm curious why null_blk isn't a good fit? You'd just need to add RAM > > > > storage to it. That would just be a separate

Re: [PATCH] loop: fix to a race condition due to the early registration of device

2017-08-08 Thread Omar Sandoval
On Mon, Aug 07, 2017 at 03:37:50PM +0300, Anton Volkov wrote: > The early device registration made possible a race leading to allocations > of disks with wrong minors. > > This patch moves the device registration further down the loop_init > function to make the race infeasible. > > Found by

Re: [BUG] nvme driver crash

2017-07-26 Thread Omar Sandoval
On Wed, Jul 26, 2017 at 10:34:43AM -0700, Christoph Hellwig wrote: > On Tue, Jul 25, 2017 at 03:24:08PM -0700, Shaohua Li wrote: > > Disable CONIFG_SMP, kernel crashes at boot time, here is the log. > > I can reproduce the issue. Unfortunately the addresss in the bug > doesn't make any sense to

Re: [PATCH] xen-blkfront: Fix handling of non-supported operations

2017-07-24 Thread Omar Sandoval
On Mon, Jul 24, 2017 at 03:10:09PM +, Bart Van Assche wrote: > On Mon, 2017-07-24 at 08:46 -0600, Jens Axboe wrote: > > On 07/21/2017 11:11 AM, Bart Van Assche wrote: > > > This patch fixes the following sparse warnings: > > > > > > drivers/block/xen-blkfront.c:916:45: warning: incorrect type

Re: [PATCH blktests] sg: add regression test for patch scsi: sg: fix SG_DXFER_FROM_DEV transfers

2017-07-14 Thread Omar Sandoval
On Thu, Jul 06, 2017 at 02:09:21PM +0200, Johannes Thumshirn wrote: > Add a regression test for the patch titled "scsi: sg: fix > SG_DXFER_FROM_DEV transfers" which reassembles the syscalls done by Nero > Burning ROM to discover CD and DVD burners. Fixed up a few things below and applied, thanks!

Re: [PATCH blktests v2] tests: use nproc to get number of CPUs for fio jobs

2017-07-14 Thread Omar Sandoval
On Fri, Jun 30, 2017 at 11:07:35AM +0200, Johannes Thumshirn wrote: > Use nproc to get number of CPUs for fio jobs and introduce > _run_fio_rand_io helper for parallel IO which we don't really care about > the details and just want some IO. Thanks, Johannes, applied with a fix below. >

Kyber benchmarks

2017-07-10 Thread Omar Sandoval
Hi, everyone, I did some benchmarks of Kyber on 4.12 that I wanted to share. If anyone else has done any testing, I'd love to see the results. == Latency Kyber's basic function is controlling latency, so the first benchmark I did was to measure latency of a mixed workload. When idle, the NVMe

Re: [PATCH] block/Kconfig.iosched: Enable BFQ on DEFAULT_IOSCHED

2017-07-04 Thread Omar Sandoval
On Tue, Jul 04, 2017 at 01:35:18PM -0300, Ben Mezger wrote: > This patch, allows BFQ to be chosen in the Default I/O scheduler prompt. Nak, this doesn't work. The default scheduler Kconfig option is for the legacy block path, but BFQ is a blk-mq scheduler. > Signed-off-by: Ben Mezger

Re: [PATCH blktests v2 0/2] Test I/O to device while resetting PCI

2017-06-27 Thread Omar Sandoval
On Tue, Jun 27, 2017 at 03:42:55PM +0200, Johannes Thumshirn wrote: > Changes to v1: > * Ignore fio errors > * add an additional sleep .2 after re-enabling the pci device > * directly call readlink in _get_pci_dev_from_blkdev() > > Johannes Thumshirn (2): > rc: add helpers to handle PCI test

Re: [PATCH blktests 1/2] rc: add helpers to handle PCI test devices

2017-06-26 Thread Omar Sandoval
On Fri, Jun 23, 2017 at 04:29:50PM +0200, Johannes Thumshirn wrote: > Add two helpers to check whether a device is attached via PCI and to get the > PCI device from a TEST_DEV > > Signed-off-by: Johannes Thumshirn > --- > common/rc | 15 +++ > 1 file changed, 15

Re: [PATCH blktests 2/2] block/011: Perform PCI reset while doing IO

2017-06-26 Thread Omar Sandoval
On Mon, Jun 26, 2017 at 08:25:36AM -0600, Jens Axboe wrote: > On 06/26/2017 08:06 AM, Johannes Thumshirn wrote: > > On Fri, Jun 23, 2017 at 09:36:14AM -0600, Jens Axboe wrote: > >> On 06/23/2017 08:29 AM, Johannes Thumshirn wrote: > >>> From: Omar Sandoval <osan

Re: [PATCH blktests 2/2] block/011: Perform PCI reset while doing IO

2017-06-26 Thread Omar Sandoval
On Fri, Jun 23, 2017 at 04:29:51PM +0200, Johannes Thumshirn wrote: > From: Omar Sandoval <osan...@fb.com> > > This test-case performs I/O with fio while doing PCI disable/enable > cycles. > > In the results we don't care for I/O errors but for hiccups in dmesg only. >

Re: [GIT PULL] New test and a fixup for blktests

2017-06-26 Thread Omar Sandoval
On Mon, Jun 26, 2017 at 03:02:55PM -0600, Jens Axboe wrote: > On 06/26/2017 02:45 PM, Omar Sandoval wrote: > > On Wed, Jun 21, 2017 at 09:22:47AM -0600, Jens Axboe wrote: > >> Hi Omar, > >> > >> Two changes here: > >> > >> - block/006 wants

Re: [GIT PULL] New test and a fixup for blktests

2017-06-26 Thread Omar Sandoval
On Wed, Jun 21, 2017 at 09:22:47AM -0600, Jens Axboe wrote: > Hi Omar, > > Two changes here: > > - block/006 wants to use the iops results, but it isn't using _fio_perf. > - Add block/010 to test for shared vs non-shared tags performance. > > > https://github.com/axboe/blktests.git axboe >

Re: [PATCH blktests] sg/001: don't require scsi_debug

2017-06-26 Thread Omar Sandoval
On Fri, Jun 23, 2017 at 10:14:48AM +0200, Johannes Thumshirn wrote: > Don't require scsi_debug but check if TEST_DEV is a SCSI device and use it > instead. > > Signed-off-by: Johannes Thumshirn > --- > tests/sg/001 | 8 +++- > 1 file changed, 3 insertions(+), 5

Re: [PATCH blktests] loop/002: Regression testing for loop device flush

2017-06-26 Thread Omar Sandoval
Hi, James, thanks for sending this in. Sorry for the delay, I've been out of the office for a couple of weeks. A few comments below. On Thu, Jun 08, 2017 at 08:28:12PM +0800, James Wang wrote: > Add a regression testing for loop device. when an unbound device > be close that take too long time.

Re: [PATCH 7/8] blk-mq: create hctx for each present CPU

2017-06-07 Thread Omar Sandoval
On Sat, Jun 03, 2017 at 04:04:02PM +0200, Christoph Hellwig wrote: > Currently we only create hctx for online CPUs, which can lead to a lot > of churn due to frequent soft offline / online operations. Instead > allocate one for each present CPU to avoid this and dramatically simplify > the code.

Re: [PATCHv7 2/2] loop: support 4k physical blocksize

2017-06-07 Thread Omar Sandoval
On Fri, Apr 07, 2017 at 10:59:29PM +0800, Ming Lei wrote: > On Fri, Apr 07, 2017 at 12:50:57PM +0200, Hannes Reinecke wrote: > > When generating bootable VM images certain systems (most notably > > s390x) require devices with 4k blocksize. This patch implements > > a new flag 'LO_FLAGS_BLOCKSIZE'

Re: [PATCH blktests v2 0/3] Add SCSI generic test group

2017-06-07 Thread Omar Sandoval
On Fri, May 19, 2017 at 03:55:28PM +0200, Johannes Thumshirn wrote: > Add a test group for the SCSI generic driver and one syzcaller > reproducer for this group. > > The reprodcuer is distributed as a C program, so the makefile is > amended to build C files to be used in the test. > > Changes to

Re: blk-mq: free callback if error occurs in blk_mq_init_allocated_queue

2017-06-01 Thread Omar Sandoval
On Thu, Jun 01, 2017 at 01:02:40PM +0800, Joseph Qi wrote: > From: Joseph Qi > > If error occurs, we have to free the allocated callback in > blk_mq_init_allocated_queue to avoid memory leaking. Nak. If blk_mq_init_allocated_queue() fails, we call blk_cleanup_queue()

Re: [PATCH 1/5] blk-mq: Only register debugfs attributes for blk-mq queues

2017-05-25 Thread Omar Sandoval
hat David reported here: https://github.com/ddiss/rapido/pull/13#event-1093484761. Thanks, Bart. Reviewed-by: Omar Sandoval <osan...@fb.com> > Fixes: commit 9c1051aacde8 ("blk-mq: untangle debugfs and sysfs") > Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> >

Re: [PATCH blktests v2 3/3] sg/001: add regression test for syzcaller generated GPF in sg_read path

2017-05-22 Thread Omar Sandoval
On Fri, May 19, 2017 at 03:55:31PM +0200, Johannes Thumshirn wrote: > Add a regression test for commit 48ae8484e9fc ("scsi: sg: don't return > bogus Sg_requests"). This is a general protection fault triggered by > syzcaller via issuing bogus read(2)s on the /dev/sg devices. > > Signed-off-by:

Re: [PATCH blktests] check: add ability to exclude a test or group

2017-05-19 Thread Omar Sandoval
On Fri, May 19, 2017 at 03:17:10PM +0200, Johannes Thumshirn wrote: > Add the ability to exclude a test or whole test group from a test > run. Thus a user can explicitly decide which tests to skip like in > this example where one wants all of the 'block' group but block/001. > > block/002 (remove

Re: [PATCH blktests 0/3] Add SCSI generic test group

2017-05-18 Thread Omar Sandoval
On Thu, May 18, 2017 at 03:29:45PM +0200, Johannes Thumshirn wrote: > On 05/18/2017 03:19 PM, Christoph Hellwig wrote: > > All SG_IO test should also apply to block device nodes that support > > the ioctl.. > > > > But these are not necessarily SG_IO tests, are they? > > The test included is

Re: [PATCH blktests 2/3] tests/sg: add SCSI generic test grouop

2017-05-18 Thread Omar Sandoval
On Thu, May 18, 2017 at 02:06:20PM -0700, Omar Sandoval wrote: > On Thu, May 18, 2017 at 02:13:07PM +0200, Johannes Thumshirn wrote: > > Add a test group for tests of the SCSI generic driver and and > > functions common to the SCSI generic driver and it's test cases. >

Re: [PATCH blktests 3/3] sg/001: add regression test for syzcaller generated GPF

2017-05-18 Thread Omar Sandoval
On Thu, May 18, 2017 at 02:13:08PM +0200, Johannes Thumshirn wrote: > Add a regression test for commit 48ae8484e9fc ("scsi: sg: don't return > bogus Sg_requests"). This is a general protection fault triggered by > syzcaller. > > Signed-off-by: Johannes Thumshirn > --- >

Re: [PATCH blktests 2/3] tests/sg: add SCSI generic test grouop

2017-05-18 Thread Omar Sandoval
On Thu, May 18, 2017 at 02:13:07PM +0200, Johannes Thumshirn wrote: > Add a test group for tests of the SCSI generic driver and and > functions common to the SCSI generic driver and it's test cases. > > Signed-off-by: Johannes Thumshirn > --- > common/sg | 22

Re: Announcing blktests

2017-05-15 Thread Omar Sandoval
On Mon, May 15, 2017 at 03:13:52PM +0300, Dmitry Monakhov wrote: > Omar Sandoval <osan...@osandov.com> writes: > > > Hi, everyone, > > > > At LSF/MM, we talked about the need for somewhere to dump tests for the > > block layer/storage stack. I've put together a

Re: Announcing blktests

2017-05-15 Thread Omar Sandoval
On Mon, May 15, 2017 at 09:44:13AM +0200, Johannes Thumshirn wrote: > On 05/12/2017 08:49 PM, Omar Sandoval wrote: > > Hi, everyone, > > > > At LSF/MM, we talked about the need for somewhere to dump tests for the > > block layer/storage stack. I've put tog

Re: Kyber scheduler brings system to halt when used on swap partition

2017-05-12 Thread Omar Sandoval
On Thu, May 11, 2017 at 02:57:24PM +0200, Markus Trippelsdorf wrote: > Using the new Kyber mq scheduler brings my system to a halt as soon as it > starts swapping. The swap partition resides on an SSD and is the only > partition in use on that drive. > Symptoms are stuttering sound and non moving

Announcing blktests

2017-05-12 Thread Omar Sandoval
Hi, everyone, At LSF/MM, we talked about the need for somewhere to dump tests for the block layer/storage stack. I've put together a test suite inspired by xfstests here: https://github.com/osandov/blktests. I started out with the opinion that we should reuse xfstests for this, but it became

[PATCH v2 12/12] mq-deadline: add debugfs attributes

2017-05-04 Thread Omar Sandoval
From: Omar Sandoval <osan...@fb.com> Expose the fifo lists, cached next requests, batching state, and dispatch list. It'd also be possible to add the sorted lists, but there aren't already seq_file helpers for rbtrees. Signed-off-by: Omar Sandoval <osan...@fb.com> --- block/blk-

[PATCH v2 06/12] blk-mq-debugfs: get rid of a bunch of boilerplate

2017-05-04 Thread Omar Sandoval
From: Omar Sandoval <osan...@fb.com> A large part of blk-mq-debugfs.c is file_operations and seq_file boilerplate. This sucks as is but will suck even more when schedulers can define their own debugfs entries. Factor it all out into a single blk_mq_debugfs_fops which multiplexes as need

[PATCH v2 01/12] blk-mq-debugfs: separate flags with |

2017-05-04 Thread Omar Sandoval
From: Omar Sandoval <osan...@fb.com> This reads more naturally than spaces. Signed-off-by: Omar Sandoval <osan...@fb.com> --- block/blk-mq-debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index

[PATCH v2 05/12] blk-mq-debugfs: rename hw queue directories from to hctx

2017-05-04 Thread Omar Sandoval
From: Omar Sandoval <osan...@fb.com> It's not clear what these numbered directories represent unless you consult the code. We're about to get rid of the intermediate "mq" directory, so these would be even more confusing without that context. Signed-off-by: Omar Sandoval

[PATCH v2 09/12] blk-mq: untangle debugfs and sysfs

2017-05-04 Thread Omar Sandoval
From: Omar Sandoval <osan...@fb.com> Originally, I tied debugfs registration/unregistration together with sysfs. There's no reason to do this, and it's getting in the way of letting schedulers define their own debugfs attributes. Instead, tie the debugfs registration to the li

[PATCH v2 11/12] kyber: add debugfs attributes

2017-05-04 Thread Omar Sandoval
From: Omar Sandoval <osan...@fb.com> Expose the domain token pools, asynchronous sbitmap depth, domain request lists, and batching state. Signed-off-by: Omar Sandoval <osan...@fb.com> --- block/blk-mq-debugfs.c | 3 +- block/blk-mq-debugfs.h | 2 + block/kyber-iosc

[PATCH v2 04/12] blk-mq-debugfs: don't open code strstrip()

2017-05-04 Thread Omar Sandoval
From: Omar Sandoval <osan...@fb.com> Slightly more readable, plus we also strip leading spaces. Signed-off-by: Omar Sandoval <osan...@fb.com> --- block/blk-mq-debugfs.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/block/blk-mq-debugfs.c b/block/blk-

[PATCH v2 08/12] blk-mq: move debugfs declarations to a separate header file

2017-05-04 Thread Omar Sandoval
From: Omar Sandoval <osan...@fb.com> Preparation for adding more declarations. Signed-off-by: Omar Sandoval <osan...@fb.com> --- block/blk-core.c | 1 + block/blk-mq-debugfs.c | 1 + block/blk-mq-debugfs.h | 29 + block/blk-mq-sysfs.c | 1 + bl

Re: [PATCH 3/9] blk-mq-debugfs: get rid of a bunch of boilerplate

2017-05-03 Thread Omar Sandoval
On Wed, May 03, 2017 at 08:51:11PM +, Bart Van Assche wrote: > On Wed, 2017-05-03 at 12:18 -0700, Omar Sandoval wrote: > > From: Omar Sandoval <osan...@fb.com> > > > > A large part of blk-mq-debugfs.c is file_operations and seq_file > > boilerplate. This su

Re: [PATCH 1/4] blk-mq: introduce BLK_MQ_F_SCHED_USE_HW_TAG

2017-05-03 Thread Omar Sandoval
On Thu, May 04, 2017 at 04:13:51AM +0800, Ming Lei wrote: > On Thu, May 4, 2017 at 12:46 AM, Omar Sandoval <osan...@osandov.com> wrote: > > On Fri, Apr 28, 2017 at 11:15:36PM +0800, Ming Lei wrote: > >> When blk-mq I/O scheduler is used, we need two tags for > >

[PATCH 8/9] kyber: add debugfs attributes

2017-05-03 Thread Omar Sandoval
From: Omar Sandoval <osan...@fb.com> Expose the domain token pools, asynchronous sbitmap depth, domain request lists, and batching state. Signed-off-by: Omar Sandoval <osan...@fb.com> --- block/blk-mq-debugfs.c | 2 +- block/blk-mq-debugfs.h | 2 + block/kyber-iosc

[PATCH 7/9] blk-mq-debugfs: allow schedulers to register debugfs attributes

2017-05-03 Thread Omar Sandoval
From: Omar Sandoval <osan...@fb.com> This provides the infrastructure for schedulers to expose their internal state through debugfs. We add a list of queue attributes and a list of hctx attributes to struct elevator_type and wire them up when switching schedulers. Signed-off-by: Omar Sa

[PATCH 9/9] mq-deadline: add debugfs attributes

2017-05-03 Thread Omar Sandoval
From: Omar Sandoval <osan...@fb.com> Expose the fifo lists, cached next requests, batching state, and dispatch list. It'd also be possible to add the sorted lists, but there aren't already seq_file helpers for rbtrees. Signed-off-by: Omar Sandoval <osan...@fb.com> --- block/blk-

[PATCH 6/9] blk-mq: untangle debugfs and sysfs

2017-05-03 Thread Omar Sandoval
From: Omar Sandoval <osan...@fb.com> Originally, I tied debugfs registration/unregistration together with sysfs. There's no reason to do this, and it's getting in the way of letting schedulers define their own debugfs attributes. Instead, tie the debugfs registration to the li

[PATCH 4/9] blk-mq: Do not invoke queue operations on a dead queue

2017-05-03 Thread Omar Sandoval
changes are going to undo that, so we need to explicitly disallow running a dead queue. [Omar: rebased and updated commit message] Signed-off-by: Omar Sandoval <osan...@fb.com> Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> --- block/blk-mq-debugfs.c | 8 1 file change

[PATCH 5/9] blk-mq: move debugfs declarations to a separate header file

2017-05-03 Thread Omar Sandoval
From: Omar Sandoval <osan...@fb.com> Preparation for adding more declarations. Signed-off-by: Omar Sandoval <osan...@fb.com> --- block/blk-core.c | 1 + block/blk-mq-debugfs.c | 1 + block/blk-mq-debugfs.h | 29 + block/blk-mq-sysfs.c | 1 + bl

[PATCH 3/9] blk-mq-debugfs: get rid of a bunch of boilerplate

2017-05-03 Thread Omar Sandoval
From: Omar Sandoval <osan...@fb.com> A large part of blk-mq-debugfs.c is file_operations and seq_file boilerplate. This sucks as is but will suck even more when schedulers can define their own debugfs entries. Factor it all out into a single blk_mq_debugfs_fops which multiplexes as need

[PATCH 0/9] blk-mq-debugfs: scheduler support and cleanups

2017-05-03 Thread Omar Sandoval
From: Omar Sandoval <osan...@fb.com> Hi, This series makes more enhancements to blk-mq-debugfs. - Patch 1 is a subjective change. - Patches 2 and 3 are cleanups. - Patch 4 is Bart's patch from a couple of weeks ago, necessitated by patch 6. - Patch 5 is another cleanup. - Patch 6 r

[PATCH 1/9] blk-mq-debugfs: separate flags with |

2017-05-03 Thread Omar Sandoval
From: Omar Sandoval <osan...@fb.com> This reads more naturally than spaces. Signed-off-by: Omar Sandoval <osan...@fb.com> --- block/blk-mq-debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index

Re: [PATCH 3/4] blk-mq: use hw tag for scheduling if hw tag space is big enough

2017-05-03 Thread Omar Sandoval
On Thu, May 04, 2017 at 12:55:30AM +0800, Ming Lei wrote: > On Wed, May 03, 2017 at 09:29:36AM -0700, Omar Sandoval wrote: > > On Fri, Apr 28, 2017 at 11:15:38PM +0800, Ming Lei wrote: > > > When tag space of one device is big enough, we use hw tag > > >

Re: [PATCH 2/4] blk-mq: introduce blk_mq_get_queue_depth()

2017-05-03 Thread Omar Sandoval
evisit this and the similar thing in Kyber. Reviewed-by: Omar Sandoval <osan...@fb.com> > Signed-off-by: Ming Lei <ming@redhat.com> > --- > block/blk-mq.c | 12 > block/blk-mq.h | 1 + > 2 files changed, 13 insertions(+) > > diff --git a/block/blk-mq.

Re: [PATCH 1/4] blk-mq: introduce BLK_MQ_F_SCHED_USE_HW_TAG

2017-05-03 Thread Omar Sandoval
On Fri, Apr 28, 2017 at 11:15:36PM +0800, Ming Lei wrote: > When blk-mq I/O scheduler is used, we need two tags for > submitting one request. One is called scheduler tag for > allocating request and scheduling I/O, another one is called > driver tag, which is used for dispatching IO to

Re: [PATCH 3/4] blk-mq: use hw tag for scheduling if hw tag space is big enough

2017-05-03 Thread Omar Sandoval
On Fri, Apr 28, 2017 at 11:15:38PM +0800, Ming Lei wrote: > When tag space of one device is big enough, we use hw tag > directly for I/O scheduling. > > Now the decision is made if hw queue depth is not less than > q->nr_requests and the tag set isn't shared. > > Signed-off-by: Ming Lei

Re: [PATCH 1/4] blk-mq: introduce BLK_MQ_F_SCHED_USE_HW_TAG

2017-05-03 Thread Omar Sandoval
On Fri, Apr 28, 2017 at 11:15:36PM +0800, Ming Lei wrote: > When blk-mq I/O scheduler is used, we need two tags for > submitting one request. One is called scheduler tag for > allocating request and scheduling I/O, another one is called > driver tag, which is used for dispatching IO to

Re: [PATCH 3/4] blk-mq: use hw tag for scheduling if hw tag space is big enough

2017-05-01 Thread Omar Sandoval
On Mon, May 01, 2017 at 03:06:16PM +, Bart Van Assche wrote: > On Sat, 2017-04-29 at 18:35 +0800, Ming Lei wrote: > > On Fri, Apr 28, 2017 at 06:09:40PM +, Bart Van Assche wrote: > > > On Fri, 2017-04-28 at 23:15 +0800, Ming Lei wrote: > > > > +static inline bool

Re: [PATCH 6/6] blk-mq-debugfs: Add 'kick' operation

2017-05-01 Thread Omar Sandoval
intuitive, but it makes enough sense if you know the code, I guess. Reviewed-by: Omar Sandoval <osan...@fb.com> > Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> > Cc: Omar Sandoval <osan...@fb.com> > Cc: Hannes Reinecke <h...@suse.com> > --- > bloc

Re: [PATCH 5/6] blk-mq-debugfs: Show busy requests

2017-05-01 Thread Omar Sandoval
t Van Assche <bart.vanass...@sandisk.com> > Cc: Omar Sandoval <osan...@fb.com> > Cc: Hannes Reinecke <h...@suse.com> > --- > block/blk-mq-debugfs.c | 38 ++ > 1 file changed, 38 insertions(+) > > diff --git a/block/blk-mq-debugfs.c b/

Re: [PATCH 3/6] blk-mq-debugfs: Show atomic request flags

2017-04-27 Thread Omar Sandoval
On Thu, Apr 27, 2017 at 08:54:34AM -0700, Bart Van Assche wrote: > When analyzing e.g. queue lockups it is important to know whether > or not a request has already been started. Hence also show the > atomic request flags. Reviewed-by: Omar Sandoval <osan...@fb.com> > Signe

Re: [PATCH 2/6] blk-mq: Fix the comment above blk_mq_quiesce_queue()

2017-04-27 Thread Omar Sandoval
queue. Hence reflect this behavior in > the comment above that function. Can you just combine this with patch 1? > Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> > Cc: Hannes Reinecke <h...@suse.com> > Cc: Omar Sandoval <osan...@fb.com> > Cc: Ming Lei

Re: [PATCH v5 05/10] blk-mq: Unregister debugfs attributes earlier

2017-04-26 Thread Omar Sandoval
On Wed, Apr 26, 2017 at 08:32:31PM +, Bart Van Assche wrote: > On Tue, 2017-04-25 at 14:30 -0700, Omar Sandoval wrote: > > Jens, could you ack that dropping the lock is okay? > > Hello Omar, > > If you have a look at the block layer history then you will see that t

Re: [PATCH v5 05/10] blk-mq: Unregister debugfs attributes earlier

2017-04-25 Thread Omar Sandoval
On Tue, Apr 25, 2017 at 10:24:48PM +, Bart Van Assche wrote: > On Tue, 2017-04-25 at 14:30 -0700, Omar Sandoval wrote: > > On Tue, Apr 25, 2017 at 01:37:40PM -0700, Bart Van Assche wrote: > > > One of the debugfs attributes allows to run a queue. Since running > > >

Re: [PATCH v5 10/10] scsi: Implement blk_mq_ops.show_rq()

2017-04-25 Thread Omar Sandoval
ingful number. For the sake of this not getting bike-shedded to death, Reviewed-by: Omar Sandoval <osan...@fb.com> > Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> > Cc: Martin K. Petersen <martin.peter...@oracle.com> > Cc: James Bottomley <james.bottom.

Re: [PATCH v5 09/10] blk-mq: Add blk_mq_ops.show_rq()

2017-04-25 Thread Omar Sandoval
On Tue, Apr 25, 2017 at 01:37:44PM -0700, Bart Van Assche wrote: > This new callback function will be used in the next patch to show > more information about SCSI requests. Reviewed-by: Omar Sandoval <osan...@fb.com> > Signed-off-by: Bart Van Assche <bart.vanass...@sandi

Re: [PATCH v5 05/10] blk-mq: Unregister debugfs attributes earlier

2017-04-25 Thread Omar Sandoval
ld you ack that dropping the lock is okay? > Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> > Reviewed-by: Hannes Reinecke <h...@suse.com> > Reviewed-by: Omar Sandoval <osan...@fb.com> > --- > block/blk-core.c | 5 + > 1 file changed, 5

Re: [PATCH v5 04/10] blk-mq: Only unregister hctxs for which registration succeeded

2017-04-25 Thread Omar Sandoval
ed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> > Cc: Omar Sandoval <osan...@fb.com> > Cc: Hannes Reinecke <h...@suse.com> > --- > block/blk-mq-sysfs.c | 18 +- > 1 file changed, 13 insertions(+), 5 deletions(-) > > diff --git

Re: [PATCH v4 10/10] scsi: Implement blk_mq_ops.show_rq()

2017-04-24 Thread Omar Sandoval
On Mon, Apr 24, 2017 at 07:19:50PM -0400, Martin K. Petersen wrote: > > Bart, > > > SCSI tracing has to be enabled before a test is started, produces a > > huge amount of data, and deriving state information from a huge trace > > is far from easy. The information in debugfs provides an easy to

Re: [PATCH v4 05/10] blk-mq: Unregister debugfs attributes earlier

2017-04-24 Thread Omar Sandoval
On Mon, Apr 24, 2017 at 10:26:15AM -0700, Omar Sandoval wrote: > On Mon, Apr 24, 2017 at 05:24:13PM +, Bart Van Assche wrote: > > On Mon, 2017-04-24 at 10:17 -0700, Omar Sandoval wrote: > > > On Mon, Apr 24, 2017 at 05:12:05PM +, Bart Van Assche wrote: > > > &g

Re: [PATCH v4 05/10] blk-mq: Unregister debugfs attributes earlier

2017-04-24 Thread Omar Sandoval
On Mon, Apr 24, 2017 at 05:24:13PM +, Bart Van Assche wrote: > On Mon, 2017-04-24 at 10:17 -0700, Omar Sandoval wrote: > > On Mon, Apr 24, 2017 at 05:12:05PM +, Bart Van Assche wrote: > > > On Mon, 2017-04-24 at 09:55 -0700, Omar Sandoval wrote: > > > > On F

Re: [PATCH v4 05/10] blk-mq: Unregister debugfs attributes earlier

2017-04-24 Thread Omar Sandoval
On Mon, Apr 24, 2017 at 05:12:05PM +, Bart Van Assche wrote: > On Mon, 2017-04-24 at 09:55 -0700, Omar Sandoval wrote: > > On Fri, Apr 21, 2017 at 04:40:21PM -0700, Bart Van Assche wrote: > > > One of the debugfs attributes allows to run a queue. Since running > > >

Re: [PATCH v4 01/10] blk-mq: Register /queue/mq after having registered /queue

2017-04-24 Thread Omar Sandoval
ebugfs_register() is called. To avoid lock inversion, > protect sysfs / debugfs registration with the queue sysfs_lock > instead of the global mutex all_q_mutex. Reviewed-by: Omar Sandoval <osan...@fb.com> > Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> > Cc: Omar

Re: [PATCH v4 05/10] blk-mq: Unregister debugfs attributes earlier

2017-04-24 Thread Omar Sandoval
before a queue reaches the "dead" state. More important than this case, I think, is that blk_cleanup_queue() calls blk_mq_free_queue(q), so most of the debugfs entries would lead to use-after-frees. If you add that to the commit message and address my comment below, Reviewed-by: Omar San

Re: [PATCH v4 04/10] blk-mq: Check blk_mq_debugfs_register() return value

2017-04-24 Thread Omar Sandoval
for which > registration succeeded. This part of it seems reasonable. > Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> > Cc: Omar Sandoval <osan...@fb.com> > Cc: Hannes Reinecke <h...@suse.com> > --- > block/blk-mq-sysfs.c | 23 +

Re: [PATCH v4 03/10] blk-mq-debugfs: Rename functions for registering and unregistering the mq directory

2017-04-24 Thread Omar Sandoval
On Fri, Apr 21, 2017 at 04:40:19PM -0700, Bart Van Assche wrote: > Since the blk_mq_debugfs_*register_hctxs() functions register and > unregister all attributes under the "mq" directory, rename these > into blk_mq_debugfs_*register_mq(). Thanks! Reviewed-by: Omar Sando

Re: [PATCH v3 3/8] blk-mq: Unregister debugfs attributes earlier

2017-04-21 Thread Omar Sandoval
On Fri, Apr 21, 2017 at 03:16:28PM -0700, Omar Sandoval wrote: > On Tue, Apr 18, 2017 at 04:29:44PM -0700, Bart Van Assche wrote: > > One of the debugfs attributes allows to run a queue. Since running > > a queue after a queue has entered the "dead" state is not allow

Re: [PATCH v3 3/8] blk-mq: Unregister debugfs attributes earlier

2017-04-21 Thread Omar Sandoval
before a queue reaches the "dead" state. > > Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> > Cc: Omar Sandoval <osan...@fb.com> > Cc: Hannes Reinecke <h...@suse.com> > --- > block/blk-mq-sysfs.c | 31 ++- >

Re: [PATCH v3 1/8] blk-mq: Register /queue/mq after having registered /queue

2017-04-21 Thread Omar Sandoval
On Fri, Apr 21, 2017 at 10:09:14PM +, Bart Van Assche wrote: > On Fri, 2017-04-21 at 15:05 -0700, Omar Sandoval wrote: > > On Tue, Apr 18, 2017 at 04:29:42PM -0700, Bart Van Assche wrote: > > > +int blk_mq_register_dev(struct device *dev, struct request_queue *q) > &

Re: [PATCH v3 2/8] blk-mq: Let blk_mq_debugfs_register() look up the queue name

2017-04-21 Thread Omar Sandoval
gfs_register() look up the queue name. Reviewed-by: Omar Sandoval <osan...@fb.com> > Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> > Cc: Omar Sandoval <osan...@fb.com> > Cc: Hannes Reinecke <h...@suse.com> > --- > block/blk-mq-debugfs.c | 5 +++--

Re: [PATCH v3 1/8] blk-mq: Register /queue/mq after having registered /queue

2017-04-21 Thread Omar Sandoval
Van Assche <bart.vanass...@sandisk.com> > Cc: Omar Sandoval <osan...@fb.com> > Cc: Hannes Reinecke <h...@suse.com> > --- > block/blk-mq-sysfs.c | 43 +++ > block/blk-mq.h | 1 + > block/blk-sysfs.c| 6 +++--- > 3 f

Re: [PATCH] blk-mq: fix schedule-while-atomic with scheduler attached

2017-04-20 Thread Omar Sandoval
On Thu, Apr 20, 2017 at 04:39:10PM -0600, Jens Axboe wrote: > On 04/20/2017 03:30 PM, Omar Sandoval wrote: > > On Thu, Apr 20, 2017 at 03:13:43PM -0600, Jens Axboe wrote: > >> We must have dropped the ctx before we call > >> blk_mq_sched_insert_request() with can_bl

Re: [PATCH] blk-mq: fix schedule-while-atomic with scheduler attached

2017-04-20 Thread Omar Sandoval
On Thu, Apr 20, 2017 at 03:41:21PM -0600, Jens Axboe wrote: > On 04/20/2017 03:30 PM, Omar Sandoval wrote: > > On Thu, Apr 20, 2017 at 03:13:43PM -0600, Jens Axboe wrote: > >> We must have dropped the ctx before we call > >> blk_mq_sched_insert_request() with can_bl

Re: [PATCH] blk-mq: fix schedule-while-atomic with scheduler attached

2017-04-20 Thread Omar Sandoval
On Thu, Apr 20, 2017 at 03:13:43PM -0600, Jens Axboe wrote: > We must have dropped the ctx before we call > blk_mq_sched_insert_request() with can_block=true, otherwise we risk > that a flush request can block on insertion if we are currently out of > tags. > > [ 47.667190] BUG: scheduling

Re: [PATCH v3 7/8] blk-mq: Add blk_mq_ops.show_rq()

2017-04-20 Thread Omar Sandoval
On Tue, Apr 18, 2017 at 04:29:48PM -0700, Bart Van Assche wrote: > This new callback function will be used in the next patch to show > more information about SCSI requests. Reviewed-by: Omar Sandoval <osan...@fb.com> > Signed-off-by: Bart Van Assche <bart.vanass...@sandi

Re: [PATCH v3 2/2] blk-mq: Add a polling specific stats function

2017-04-20 Thread Omar Sandoval
On Thu, Apr 20, 2017 at 02:16:04PM -0600, Jens Axboe wrote: > On 04/20/2017 02:07 PM, Omar Sandoval wrote: > > On Fri, Apr 07, 2017 at 06:24:03AM -0600, sba...@raithlin.com wrote: > >> From: Stephen Bates <sba...@raithlin.com> > >> > >> Rather than bucketi

Re: [PATCH v3 2/2] blk-mq: Add a polling specific stats function

2017-04-20 Thread Omar Sandoval
On Fri, Apr 07, 2017 at 06:24:03AM -0600, sba...@raithlin.com wrote: > From: Stephen Bates > > Rather than bucketing IO statisics based on direction only we also > bucket based on the IO size. This leads to improved polling > performance. Update the bucket callback function

Re: [PATCH 0/4] blk-mq-sched: allow to use hw tag for sched

2017-04-17 Thread Omar Sandoval
On Mon, Apr 17, 2017 at 12:03:53AM +0800, Ming Lei wrote: > On Sat, Apr 15, 2017 at 08:38:21PM +0800, Ming Lei wrote: > > The 1st patch enhances BLK_MQ_F_NO_SCHED so that we can't change/ > > show available io schedulers on devices which don't support io > > scheduler. > > > > The 2nd patch

Re: [PATCH 1/6] blk-mq: Do not invoke queue operations on a dead queue

2017-04-14 Thread Omar Sandoval
On Fri, Apr 14, 2017 at 04:12:01PM +, Bart Van Assche wrote: > On Fri, 2017-04-14 at 00:40 -0700, Omar Sandoval wrote: > > On Thu, Apr 13, 2017 at 11:05:32PM +, Bart Van Assche wrote: > > > On Thu, 2017-04-13 at 16:01 -0700, Omar Sandoval wrote: > > > > Lo

[PATCH v4 5/5] blk-mq: introduce Kyber multiqueue I/O scheduler

2017-04-14 Thread Omar Sandoval
From: Omar Sandoval <osan...@fb.com> The Kyber I/O scheduler is an I/O scheduler for fast devices designed to scale to multiple queues. Users configure only two knobs, the target read and synchronous write latencies, and the scheduler tunes itself to achieve that latency goal. The implemen

[PATCH v4 2/5] blk-mq: add shallow depth option for blk_mq_get_tag()

2017-04-14 Thread Omar Sandoval
From: Omar Sandoval <osan...@fb.com> Wire up the sbitmap_get_shallow() operation to the tag code so that a caller can limit the number of tags available to it. Signed-off-by: Omar Sandoval <osan...@fb.com> --- block/blk-mq-tag.c | 5 - block/blk-mq.h | 1 + 2 files changed,

[PATCH v4 1/5] sbitmap: add sbitmap_get_shallow() operation

2017-04-14 Thread Omar Sandoval
From: Omar Sandoval <osan...@fb.com> This operation supports the use case of limiting the number of bits that can be allocated for a given operation. Rather than setting aside some bits at the end of the bitmap, we can set aside bits in each word of the bitmap. This means we ca

<    1   2   3   4   5   6   7   >