Re: [PATCH] blk-mq: Export queue state through /sys/kernel/debug/block/*/state

2017-03-29 Thread Hannes Reinecke
On 03/29/2017 10:20 PM, Bart Van Assche wrote: > Make it possible to check whether or not a block layer queue has > been stopped. Make it possible to run a blk-mq queue from user > space. > > Signed-off-by: Bart Van Assche > Cc: Omar Sandoval > Cc: Hannes Reinecke > --- > block/blk-mq-debugfs.

[PATCH] block: do not put mq context in blk_mq_alloc_request_hctx

2017-03-29 Thread Minchan Kim
In blk_mq_alloc_request_hctx, blk_mq_sched_get_request doesn't get sw context so we don't need to put the context with blk_mq_put_ctx. Unless, we will see preempt counter underflow. Cc: Sagi Grimberg Cc: Omar Sandoval Cc: Jens Axboe Signed-off-by: Minchan Kim --- Maybe, it would be fixed by s

Re: [PATCH 03/23] sd: implement REQ_OP_WRITE_ZEROES

2017-03-29 Thread Martin K. Petersen
Bart Van Assche writes: Hi Bart, > A quote from SBC: "An OPTIMAL UNMAP GRANULARITY field set to a > non-zero value indicates the optimal granularity in logical blocks for > unmap requests (e.g., an UNMAP command or a WRITE SAME (16) command > with the UNMAP bit set to one). An unmap request wit

[PATCH] blk-mq: Export queue state through /sys/kernel/debug/block/*/state

2017-03-29 Thread Bart Van Assche
Make it possible to check whether or not a block layer queue has been stopped. Make it possible to start and to run a blk-mq queue from user space. Signed-off-by: Bart Van Assche Cc: Omar Sandoval Cc: Hannes Reinecke --- Changes compared to v1: - Constified blk_queue_flag_name. - Left out QUE

[GIT PULL] Block fixes for 4.11-rc

2017-03-29 Thread Jens Axboe
Hi Linus, 5 fixes for this series. This pull request contains: - A fix from me to ensure that blk-mq drivers that terminate IO in their ->queue_rq() handler by returning QUEUE_ERROR don't stall with a scheduler enabled. - 4 nbd fixes from Josef and Ratna, fixing various problems that are c

Re: v4.11-rc blk-mq lockup?

2017-03-29 Thread Bart Van Assche
On 03/28/2017 09:30 AM, Jens Axboe wrote: > On 03/28/2017 10:25 AM, Bart Van Assche wrote: >> I do not know whether it would be possible to modify the test such that only >> the dm driver is involved but no SCSI code. > > How about the other way around? Just SCSI, but no dm? Hello Jens, Sorry bu

Re: [PATCH] blk-mq: Export queue state through /sys/kernel/debug/block/*/state

2017-03-29 Thread Jens Axboe
On 03/29/2017 02:20 PM, Bart Van Assche wrote: > Make it possible to check whether or not a block layer queue has > been stopped. Make it possible to run a blk-mq queue from user > space. I like this, I've had run-this-queue wired up as well from sysfs in the past. Maybe we should push it one furt

[PATCH] blk-mq: Export queue state through /sys/kernel/debug/block/*/state

2017-03-29 Thread Bart Van Assche
Make it possible to check whether or not a block layer queue has been stopped. Make it possible to run a blk-mq queue from user space. Signed-off-by: Bart Van Assche Cc: Omar Sandoval Cc: Hannes Reinecke --- block/blk-mq-debugfs.c | 84 ++ 1 file

Re: [PATCH] block-mq: don't re-queue if we get a queue error

2017-03-29 Thread Jens Axboe
On 03/28/2017 02:37 PM, Josef Bacik wrote: > When try to issue a request directly and we fail we will requeue the > request, but call blk_mq_end_request() as well. This leads to the > completed request being on a queuelist and getting ended twice, which > causes list corruption in schedulers and o

Re: [PATCH] block-mq: don't re-queue if we get a queue error

2017-03-29 Thread Sagi Grimberg
Looks good, Reviewed-by: Sagi Grimberg

Re: [PATCH] blk-mq-pci: Fix two spelling mistakes

2017-03-29 Thread Jens Axboe
On 03/29/2017 11:04 AM, Sagi Grimberg wrote: > Signed-off-by: Sagi Grimberg Applied, thanks. -- Jens Axboe

Re: [PATCH v2 1/3] block: warn if sharing request queue across gendisks

2017-03-29 Thread Omar Sandoval
On Wed, Mar 29, 2017 at 08:10:35AM -0600, Jens Axboe wrote: > On Tue, Mar 28 2017, Omar Sandoval wrote: > > From: Omar Sandoval > > > > Now that the remaining drivers have been converted to one request queue > > per gendisk, let's warn if a request queue gets registered more than > > once. This w

Re: kmemleak complaints on request queue stats (virtio)

2017-03-29 Thread Sagi Grimberg
You don't mention what you are running? But I'm assuming it was my 4.12 branch. Ehh, details... If so, this is fixed in a later revision of it. If you pull an update, it should go away. Will try, thanks Jens.

[PATCH] blk-mq-pci: Fix two spelling mistakes

2017-03-29 Thread Sagi Grimberg
Signed-off-by: Sagi Grimberg --- block/blk-mq-pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-mq-pci.c b/block/blk-mq-pci.c index 966c2169762e..0c3354cf3552 100644 --- a/block/blk-mq-pci.c +++ b/block/blk-mq-pci.c @@ -23,7 +23,7 @@ * @pdev: PCI device as

Re: kmemleak complaints on request queue stats (virtio)

2017-03-29 Thread Jens Axboe
On 03/29/2017 11:02 AM, Sagi Grimberg wrote: > Hi, > > I just got the below kmemleak report. Just thought I'd send it > out as I don't have time to look into it just now... > > -- > unreferenced object 0x8ab236717920 (size 32): >comm "swapper/0", pid 1, jiffies 4294892551 (age 9966.044s)

kmemleak complaints on request queue stats (virtio)

2017-03-29 Thread Sagi Grimberg
Hi, I just got the below kmemleak report. Just thought I'd send it out as I don't have time to look into it just now... -- unreferenced object 0x8ab236717920 (size 32): comm "swapper/0", pid 1, jiffies 4294892551 (age 9966.044s) hex dump (first 32 bytes): 20 79 71 36 b2 8a ff ff 20 7

Re: [PATCH 03/23] sd: implement REQ_OP_WRITE_ZEROES

2017-03-29 Thread Paolo Bonzini
On 29/03/2017 18:28, Bart Van Assche wrote: > On Wed, 2017-03-29 at 16:51 +0200, Paolo Bonzini wrote: >> On 28/03/2017 20:50, Bart Van Assche wrote: >>> This means that just like the start and end of a discard must be aligned on >>> a >>> discard_granularity boundary, WRITE SAME commands with th

Re: [PATCH 03/23] sd: implement REQ_OP_WRITE_ZEROES

2017-03-29 Thread Bart Van Assche
On Wed, 2017-03-29 at 16:51 +0200, Paolo Bonzini wrote: > On 28/03/2017 20:50, Bart Van Assche wrote: > > This means that just like the start and end of a discard must be aligned on > > a > > discard_granularity boundary, WRITE SAME commands with the UNMAP bit set > > must > > also respect that g

Re: RFC: always use REQ_OP_WRITE_ZEROES for zeroing offload

2017-03-29 Thread Paolo Bonzini
On 23/03/2017 23:53, Lars Ellenberg wrote: > Thin does not claim to zero data on discard. which is ok, and correct, > because it only punches holes on full chunks (or whatever you call > them), and leaves the rest in the mapping tree as is. > > And that behaviour would prevent DRBD from exposin

Re: [PATCH 12/23] sd: handle REQ_UNMAP

2017-03-29 Thread Paolo Bonzini
On 28/03/2017 18:48, Bart Van Assche wrote: >> +if (rq->cmd_flags & REQ_UNMAP) { >> +switch (sdkp->provisioning_mode) { >> +case SD_LBP_WS16: >> +return sd_setup_write_same16_cmnd(cmd, true); >> +case SD_LBP_WS10: >> +

Re: [PATCH 23/23] block: remove the discard_zeroes_data flag

2017-03-29 Thread Paolo Bonzini
On 28/03/2017 19:00, Bart Van Assche wrote: > On Thu, 2017-03-23 at 10:33 -0400, Christoph Hellwig wrote: >> Now that we use the proper REQ_OP_WRITE_ZEROES operation everywhere we can >> kill this hack. >> >> [ ... ] >> >> diff --git a/Documentation/ABI/testing/sysfs-block >> b/Documentation/ABI

Re: [PATCH 03/23] sd: implement REQ_OP_WRITE_ZEROES

2017-03-29 Thread Paolo Bonzini
On 28/03/2017 20:50, Bart Van Assche wrote: > > This means that just like the start and end of a discard must be aligned on a > discard_granularity boundary, WRITE SAME commands with the UNMAP bit set must > also respect that granularity. I think this means that either > __blkdev_issue_zeroout()

Re: [PATCH v2 1/3] block: warn if sharing request queue across gendisks

2017-03-29 Thread Jens Axboe
On Tue, Mar 28 2017, Omar Sandoval wrote: > From: Omar Sandoval > > Now that the remaining drivers have been converted to one request queue > per gendisk, let's warn if a request queue gets registered more than > once. This will catch future drivers which might do it inadvertently or > any old dr

Re: [PATCH v3 0/4] block: misc changes

2017-03-29 Thread Jens Axboe
On Wed, Mar 29 2017, Ming Lei wrote: > On Mon, Mar 27, 2017 at 08:06:54PM +0800, Ming Lei wrote: > > Hi, > > > > The 1st patch add comments on blk-mq races with timeout handler. > > > > The other 3 patches improves handling for dying queue: > > - the 2nd one adds one barrier in blk_queue_ent

[PATCH 15/25] exofs: Convert to separately allocated bdi

2017-03-29 Thread Jan Kara
Allocate struct backing_dev_info separately instead of embedding it inside the superblock. This unifies handling of bdi among users. CC: Boaz Harrosh CC: Benny Halevy Acked-by: Boaz Harrosh Signed-off-by: Jan Kara --- fs/exofs/exofs.h | 1 - fs/exofs/super.c | 17 ++--- 2 files c

[PATCH 10/25] cifs: Convert to separately allocated bdi

2017-03-29 Thread Jan Kara
Allocate struct backing_dev_info separately instead of embedding it inside superblock. This unifies handling of bdi among users. CC: Steve French CC: linux-c...@vger.kernel.org Signed-off-by: Jan Kara --- fs/cifs/cifs_fs_sb.h | 1 - fs/cifs/cifsfs.c | 7 ++- fs/cifs/connect.c| 10

[PATCH 23/25] fs: Remove SB_I_DYNBDI flag

2017-03-29 Thread Jan Kara
Now that all bdi structures filesystems use are properly refcounted, we can remove the SB_I_DYNBDI flag. Signed-off-by: Jan Kara --- drivers/mtd/mtdsuper.c | 1 - fs/gfs2/ops_fstype.c | 1 - fs/nfs/super.c | 1 - fs/nilfs2/super.c | 1 - fs/super.c | 5 + include/l

[PATCH 20/25] ncpfs: Convert to separately allocated bdi

2017-03-29 Thread Jan Kara
Allocate struct backing_dev_info separately instead of embedding it inside the superblock. This unifies handling of bdi among users. CC: Petr Vandrovec Acked-by: Petr Vandrovec Signed-off-by: Jan Kara --- fs/ncpfs/inode.c | 8 ++-- fs/ncpfs/ncp_fs_sb.h | 1 - 2 files changed, 2 inserti

[PATCH 01/25] bdi: Provide bdi_register_va() and bdi_alloc()

2017-03-29 Thread Jan Kara
Add function that registers bdi and takes va_list instead of variable number of arguments. Add bdi_alloc() as simple wrapper for NUMA-unaware users allocating BDI. Signed-off-by: Jan Kara --- include/linux/backing-dev.h | 6 ++ mm/backing-dev.c| 20 +++- 2 files

[PATCH 06/25] lustre: Convert to separately allocated bdi

2017-03-29 Thread Jan Kara
Allocate struct backing_dev_info separately instead of embedding it inside superblock. This unifies handling of bdi among users. CC: Oleg Drokin CC: Andreas Dilger CC: James Simmons CC: lustre-de...@lists.lustre.org Reviewed-by: Andreas Dilger Signed-off-by: Jan Kara --- .../staging/lustre/l

[PATCH 18/25] gfs2: Convert to properly refcounting bdi

2017-03-29 Thread Jan Kara
Similarly to set_bdev_super() GFS2 just used block device reference to bdi. Convert it to properly getting bdi reference. The reference will get automatically dropped on superblock destruction. CC: Steven Whitehouse CC: Bob Peterson CC: cluster-de...@redhat.com Signed-off-by: Jan Kara --- fs/g

[PATCH 04/25] fs: Provide infrastructure for dynamic BDIs in filesystems

2017-03-29 Thread Jan Kara
Provide helper functions for setting up dynamically allocated backing_dev_info structures for filesystems and cleaning them up on superblock destruction. CC: linux-...@lists.infradead.org CC: linux-...@vger.kernel.org CC: Petr Vandrovec CC: linux-ni...@vger.kernel.org CC: cluster-de...@redhat.com

[PATCH 13/25] mtd: Convert to dynamically allocated bdi infrastructure

2017-03-29 Thread Jan Kara
MTD already allocates backing_dev_info dynamically. Convert it to use generic infrastructure for this including proper refcounting. We drop mtd->backing_dev_info as its only use was to pass mtd_bdi pointer from one file into another and if we wanted to keep that in a clean way, we'd have to make mt

[PATCH 05/25] fs: Get proper reference for s_bdi

2017-03-29 Thread Jan Kara
So far we just relied on block device to hold a bdi reference for us while the filesystem is mounted. While that works perfectly fine, it is a bit awkward that we have a pointer to a refcounted structure in the superblock without proper reference. So make s_bdi hold a proper reference to block devi

[PATCH 02/25] block: Unregister bdi on last reference drop

2017-03-29 Thread Jan Kara
Most users will want to unregister bdi when dropping last reference to a bdi. Only a few users (like block devices) want to play more complex tricks with bdi registration and unregistration. So unregister bdi when the last reference to bdi is dropped and just make sure we don't unregister the bdi t

[PATCH 09/25] ceph: Convert to separately allocated bdi

2017-03-29 Thread Jan Kara
Allocate struct backing_dev_info separately instead of embedding it inside client structure. This unifies handling of bdi among users. CC: Ilya Dryomov CC: "Yan, Zheng" CC: Sage Weil CC: ceph-de...@vger.kernel.org Signed-off-by: Jan Kara --- fs/ceph/addr.c| 6 +++--- fs/ceph/debugfs.c |

[PATCH 11/25] ecryptfs: Convert to separately allocated bdi

2017-03-29 Thread Jan Kara
Allocate struct backing_dev_info separately instead of embedding it inside the superblock. This unifies handling of bdi among users. CC: Tyler Hicks CC: ecryp...@vger.kernel.org Acked-by: Tyler Hicks Signed-off-by: Jan Kara --- fs/ecryptfs/ecryptfs_kernel.h | 1 - fs/ecryptfs/main.c

[PATCH 08/25] btrfs: Convert to separately allocated bdi

2017-03-29 Thread Jan Kara
Allocate struct backing_dev_info separately instead of embedding it inside superblock. This unifies handling of bdi among users. CC: Chris Mason CC: Josef Bacik CC: David Sterba CC: linux-bt...@vger.kernel.org Reviewed-by: Liu Bo Reviewed-by: David Sterba Signed-off-by: Jan Kara --- fs/btrf

[PATCH 03/25] bdi: Export bdi_alloc_node() and bdi_put()

2017-03-29 Thread Jan Kara
MTD will want to call bdi_alloc_node() and bdi_put() directly. Export these functions. Signed-off-by: Jan Kara --- mm/backing-dev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 164ccc93690f..3dd175986390 100644 --- a/mm/backing-dev.c +++ b/mm/ba

[PATCH 14/25] coda: Convert to separately allocated bdi

2017-03-29 Thread Jan Kara
Allocate struct backing_dev_info separately instead of embedding it inside the superblock. This unifies handling of bdi among users. CC: Jan Harkes CC: c...@cs.cmu.edu CC: codal...@coda.cs.cmu.edu Signed-off-by: Jan Kara --- fs/coda/inode.c| 11 --- include/linux/coda_psdev.

[PATCH 17/25] fuse: Get rid of bdi_initialized

2017-03-29 Thread Jan Kara
It is not needed anymore since bdi is initialized whenever superblock exists. CC: Miklos Szeredi CC: linux-fsde...@vger.kernel.org Suggested-by: Miklos Szeredi Signed-off-by: Jan Kara --- fs/fuse/dev.c| 5 ++--- fs/fuse/fuse_i.h | 3 --- fs/fuse/inode.c | 2 -- 3 files changed, 2 insertio

[PATCH 24/25] block: Remove unused functions

2017-03-29 Thread Jan Kara
Now that all backing_dev_info structure are allocated separately, we can drop some unused functions. Signed-off-by: Jan Kara --- include/linux/backing-dev.h | 5 mm/backing-dev.c| 56 + 2 files changed, 6 insertions(+), 55 deletions(-

[PATCH 19/25] nilfs2: Convert to properly refcounting bdi

2017-03-29 Thread Jan Kara
Similarly to set_bdev_super() NILFS2 just used block device reference to bdi. Convert it to properly getting bdi reference. The reference will get automatically dropped on superblock destruction. CC: Ryusuke Konishi CC: linux-ni...@vger.kernel.org Signed-off-by: Jan Kara --- fs/nilfs2/super.c |

[PATCH 16/25] fuse: Convert to separately allocated bdi

2017-03-29 Thread Jan Kara
Allocate struct backing_dev_info separately instead of embedding it inside the superblock. This unifies handling of bdi among users. CC: Miklos Szeredi CC: linux-fsde...@vger.kernel.org Acked-by: Miklos Szeredi Signed-off-by: Jan Kara --- fs/fuse/dev.c| 8 fs/fuse/fuse_i.h | 3 -

[PATCH 21/25] nfs: Convert to separately allocated bdi

2017-03-29 Thread Jan Kara
Allocate struct backing_dev_info separately instead of embedding it inside the superblock. This unifies handling of bdi among users. CC: Trond Myklebust CC: Anna Schumaker CC: linux-...@vger.kernel.org Signed-off-by: Jan Kara --- fs/nfs/client.c | 10 -- fs/nfs/internal.h

[PATCH 22/25] ubifs: Convert to separately allocated bdi

2017-03-29 Thread Jan Kara
Allocate struct backing_dev_info separately instead of embedding it inside the superblock. This unifies handling of bdi among users. CC: Richard Weinberger CC: Artem Bityutskiy CC: Adrian Hunter CC: linux-...@lists.infradead.org Acked-by: Richard Weinberger Signed-off-by: Jan Kara --- fs/ubi

[PATCH 07/25] 9p: Convert to separately allocated bdi

2017-03-29 Thread Jan Kara
Allocate struct backing_dev_info separately instead of embedding it inside session. This unifies handling of bdi among users. CC: Eric Van Hensbergen CC: Ron Minnich CC: Latchesar Ionkov CC: v9fs-develo...@lists.sourceforge.net Signed-off-by: Jan Kara --- fs/9p/v9fs.c | 10 +- fs

[PATCH 0/25 v2] fs: Convert all embedded bdis into separate ones

2017-03-29 Thread Jan Kara
Hello, this is the second revision of the patch series which converts all embedded occurences of struct backing_dev_info to use standalone dynamically allocated structures. This makes bdi handling unified across all bdi users and generally removes some boilerplate code from filesystems setting up

[PATCH 25/25] bdi: Drop 'parent' argument from bdi_register[_va]()

2017-03-29 Thread Jan Kara
Drop 'parent' argument of bdi_register() and bdi_register_va(). It is always NULL. Signed-off-by: Jan Kara --- drivers/mtd/mtdcore.c | 2 +- fs/super.c | 2 +- include/linux/backing-dev.h | 9 - mm/backing-dev.c| 13 + 4 files changed, 1

[PATCH 12/25] afs: Convert to separately allocated bdi

2017-03-29 Thread Jan Kara
Allocate struct backing_dev_info separately instead of embedding it inside the superblock. This unifies handling of bdi among users. CC: David Howells CC: linux-...@lists.infradead.org Signed-off-by: Jan Kara --- fs/afs/internal.h | 1 - fs/afs/super.c| 5 - fs/afs/volume.c | 8 --