Re: [PATCH v3] scsi, block: fix duplicate bdi name registration crashes

2017-02-01 Thread Jens Axboe
On 02/01/2017 02:40 PM, Dan Williams wrote: > On Wed, Feb 1, 2017 at 2:35 PM, Jens Axboe wrote: >> On 02/01/2017 02:05 PM, Dan Williams wrote: >>> Warnings of the following form occur because scsi reuses a devt number >>> while the block layer still has it referenced as the name

Re: [PATCH v3] scsi, block: fix duplicate bdi name registration crashes

2017-02-01 Thread Jens Axboe
On 02/01/2017 02:05 PM, Dan Williams wrote: > Warnings of the following form occur because scsi reuses a devt number > while the block layer still has it referenced as the name of the bdi > [1]: > > WARNING: CPU: 1 PID: 93 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x62/0x80 > sysfs: cannot create

[PATCH] nbd: use an idr to keep track of nbd devices

2017-02-01 Thread Josef Bacik
To prepare for dynamically adding new nbd devices to the system switch from using an array for the nbd devices and instead use an idr. This copies what loop does for keeping track of its devices. Signed-off-by: Josef Bacik --- drivers/block/nbd.c | 213

[PATCH] nbd: use our own workqueue for recv threads

2017-02-01 Thread Josef Bacik
Since we are in the memory reclaim path we need our recv work to be on a workqueue that has WQ_MEM_RECLAIM set so we can avoid deadlocks. Also set WQ_HIGHPRI since we are in the completion path for IO. Signed-off-by: Josef Bacik --- drivers/block/nbd.c | 13 +++-- 1 file

Re: [PATCH v3] scsi, block: fix duplicate bdi name registration crashes

2017-02-01 Thread Dan Williams
On Wed, Feb 1, 2017 at 2:35 PM, Jens Axboe wrote: > On 02/01/2017 02:05 PM, Dan Williams wrote: >> Warnings of the following form occur because scsi reuses a devt number >> while the block layer still has it referenced as the name of the bdi >> [1]: >> >> WARNING: CPU: 1 PID: 93

Re: [PATCH 3/4] block: Dynamically allocate and refcount backing_dev_info

2017-02-01 Thread Jens Axboe
On 02/01/2017 04:22 AM, Jan Kara wrote: > On Wed 01-02-17 01:50:07, Christoph Hellwig wrote: >> On Tue, Jan 31, 2017 at 01:54:28PM +0100, Jan Kara wrote: >>> Instead of storing backing_dev_info inside struct request_queue, >>> allocate it dynamically, reference count it, and free it when the last

Re: [PATCH] block: queue lock must be acquired when iterating over rls

2017-02-01 Thread Jens Axboe
On 01/31/2017 10:36 PM, Tahsin Erdogan wrote: > blk_set_queue_dying() does not acquire queue lock before it calls > blk_queue_for_each_rl(). This allows a racing blkg_destroy() to > remove blkg->q_node from the linked list and have > blk_queue_for_each_rl() loop infitely over the removed

Re: [PATCH] nbd: use an idr to keep track of nbd devices

2017-02-01 Thread Jens Axboe
On 02/01/2017 01:11 PM, Josef Bacik wrote: > To prepare for dynamically adding new nbd devices to the system switch > from using an array for the nbd devices and instead use an idr. This > copies what loop does for keeping track of its devices. Applied for 4.11, thanks. -- Jens Axboe -- To

Re: [PATCH] nbd: use our own workqueue for recv threads

2017-02-01 Thread Jens Axboe
On 02/01/2017 01:11 PM, Josef Bacik wrote: > Since we are in the memory reclaim path we need our recv work to be on a > workqueue that has WQ_MEM_RECLAIM set so we can avoid deadlocks. Also > set WQ_HIGHPRI since we are in the completion path for IO. Applied for 4.11. -- Jens Axboe -- To

Re: [PATCH 7/8] mq-deadline: add blk-mq adaptation of the deadline IO scheduler

2017-02-01 Thread Jens Axboe
On 02/01/2017 04:11 AM, Paolo Valente wrote: >> +static bool dd_bio_merge(struct blk_mq_hw_ctx *hctx, struct bio *bio) >> +{ >> +struct request_queue *q = hctx->queue; >> +struct deadline_data *dd = q->elevator->elevator_data; >> +int ret; >> + >> +spin_lock(>lock); >> +ret =

Re: [PATCH 7/8] mq-deadline: add blk-mq adaptation of the deadline IO scheduler

2017-02-01 Thread Jens Axboe
On 02/01/2017 04:56 AM, Paolo Valente wrote: >> +/* >> + * add rq to rbtree and fifo >> + */ >> +static void dd_insert_request(struct blk_mq_hw_ctx *hctx, struct request >> *rq, >> + bool at_head) >> +{ >> +struct request_queue *q = hctx->queue; >> +struct

Re: [RFC PATCH 10/17] block: introduce bdev_dax_direct_access()

2017-02-01 Thread Dan Williams
On Wed, Feb 1, 2017 at 12:10 AM, Christoph Hellwig wrote: > On Mon, Jan 30, 2017 at 10:16:29AM -0800, Dan Williams wrote: >> Ok, now that dax_map_atomic() is gone, it's much easier to remove >> struct blk_dax_ctl. >> >> We can also move the partition alignment checks to be a one-time

Re: [PATCH 2/2] nvme: allocate nvme_queue in correct node

2017-02-01 Thread Christoph Hellwig
> + mask = pci_irq_get_affinity(to_pci_dev(dev->dev), i); > + if (mask) { > + node = cpu_to_node(cpumask_first(mask)); > + node = local_memory_node(node); > + } Can you move this to a PCI-layer helper, e.g. something

Re: [PATCH 4/4] block: Make blk_get_backing_dev_info() safe without open bdev

2017-02-01 Thread Christoph Hellwig
Looks fine: Reviewed-by: Christoph Hellwig But can you also add another patch to kill off blk_get_backing_dev_info? The direct dereference is short and cleaner. Additionally the bt_bdi field in XFS could go away, too. -- To unsubscribe from this list: send the line "unsubscribe

Re: [RFC PATCH 10/17] block: introduce bdev_dax_direct_access()

2017-02-01 Thread Christoph Hellwig
On Mon, Jan 30, 2017 at 10:16:29AM -0800, Dan Williams wrote: > Ok, now that dax_map_atomic() is gone, it's much easier to remove > struct blk_dax_ctl. > > We can also move the partition alignment checks to be a one-time check > at bdev_dax_capable() time and kill bdev_dax_direct_access() in

Re: [PATCH 0/6] block: fix blk-mq debugfs vs. blktrace

2017-02-01 Thread Greg Kroah-Hartman
On Tue, Jan 31, 2017 at 02:53:16PM -0800, Omar Sandoval wrote: > From: Omar Sandoval > > When I moved the blk-mq debugging information to debugfs, I didn't > realize that blktrace also created directories in debugfs that > conflicted with the blk-mq directories. This series fixes

Re: [PATCH 0/6] block: fix blk-mq debugfs vs. blktrace

2017-02-01 Thread Omar Sandoval
On Wed, Feb 01, 2017 at 09:16:08AM +0100, Greg Kroah-Hartman wrote: > On Tue, Jan 31, 2017 at 02:53:16PM -0800, Omar Sandoval wrote: > > From: Omar Sandoval > > > > When I moved the blk-mq debugging information to debugfs, I didn't > > realize that blktrace also created

Re: [RFC PATCH 13/17] fs: update mount_bdev() to lookup dax infrastructure

2017-02-01 Thread Christoph Hellwig
On Mon, Jan 30, 2017 at 10:29:12AM -0800, Dan Williams wrote: > On Mon, Jan 30, 2017 at 4:26 AM, Christoph Hellwig wrote: > > On Sat, Jan 28, 2017 at 12:37:14AM -0800, Dan Williams wrote: > >> This is in preparation for removing the ->direct_access() method from > >>

Re: [RFC PATCH] scsi, block: fix duplicate bdi name registration crashes

2017-02-01 Thread Christoph Hellwig
On Mon, Jan 30, 2017 at 12:57:05PM -0800, Dan Williams wrote: > > struct kref { > atomic_t refcount; > }; > > ...so what do we gain by open coding kref_get() and kref_put()? A much less ugly calling convention. -- To unsubscribe from this list: send the line "unsubscribe linux-block" in

Re: [PATCH 3/4] block: Dynamically allocate and refcount backing_dev_info

2017-02-01 Thread Christoph Hellwig
On Tue, Jan 31, 2017 at 01:54:28PM +0100, Jan Kara wrote: > Instead of storing backing_dev_info inside struct request_queue, > allocate it dynamically, reference count it, and free it when the last > reference is dropped. Currently only request_queue holds the reference > but in the following

Re: [RFC PATCH 13/17] fs: update mount_bdev() to lookup dax infrastructure

2017-02-01 Thread Dan Williams
On Wed, Feb 1, 2017 at 12:08 AM, Christoph Hellwig wrote: > On Mon, Jan 30, 2017 at 10:29:12AM -0800, Dan Williams wrote: >> On Mon, Jan 30, 2017 at 4:26 AM, Christoph Hellwig wrote: >> > On Sat, Jan 28, 2017 at 12:37:14AM -0800, Dan Williams wrote: >> >> This is in

Re: [PATCH 2/4] block: Use pointer to backing_dev_info from request_queue

2017-02-01 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [RFC PATCH 10/17] block: introduce bdev_dax_direct_access()

2017-02-01 Thread Christoph Hellwig
On Wed, Feb 01, 2017 at 01:21:40AM -0800, Dan Williams wrote: > > In/Out parameters are always a bit problematic in terms of API clarity. > > And updating a device-relative address with an absolute physical one > > sounds like an odd API for sure. > > Yes, it does, and I thought better of it

Re: remove the cmd_type field from struct request

2017-02-01 Thread Bartlomiej Zolnierkiewicz
Hi, On Tuesday, January 31, 2017 10:02:50 AM Jens Axboe wrote: > On 01/31/2017 07:57 AM, Christoph Hellwig wrote: > > [1] which were a pain in the ass to untangle and debug during development, > > it's really time for it to die.. > > Outside of the patch series in question, how to we expedite

Re: [RFC PATCH] scsi, block: fix duplicate bdi name registration crashes

2017-02-01 Thread Christoph Hellwig
On Mon, Jan 30, 2017 at 01:53:36PM -0800, Dan Williams wrote: > On Mon, Jan 30, 2017 at 4:24 AM, Christoph Hellwig wrote: > > Hi Dan, > > > > this looks mostly fine to me. A few code comments below, but except > > for this there is another issue with it: We still have drivers > >

Re: [PATCH 1/2] blk-mq: allocate blk_mq_tags and requests in correct node

2017-02-01 Thread Christoph Hellwig
Hi Shaohua, the code your patching has changed a lot in Jens' tree, so I think you'll have to respin it. But the idea looks fine. -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [PATCH 1/4] block: Unhash block device inodes on gendisk destruction

2017-02-01 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: remove the cmd_type field from struct request

2017-02-01 Thread Sergei Shtylyov
On 2/1/2017 9:53 AM, Hannes Reinecke wrote: [1] which were a pain in the ass to untangle and debug during development, it's really time for it to die.. Outside of the patch series in question, how to we expedite the euthanasia of IDE? What explicit features/support are we missing through

Re: [PATCH 7/8] mq-deadline: add blk-mq adaptation of the deadline IO scheduler

2017-02-01 Thread Paolo Valente
> Il giorno 17 dic 2016, alle ore 01:12, Jens Axboe ha scritto: > > This is basically identical to deadline-iosched, except it registers > as a MQ capable scheduler. This is still a single queue design. > > Signed-off-by: Jens Axboe > --- > block/Kconfig.iosched |

Re: [PATCH 3/4] block: Dynamically allocate and refcount backing_dev_info

2017-02-01 Thread Jan Kara
On Wed 01-02-17 01:50:07, Christoph Hellwig wrote: > On Tue, Jan 31, 2017 at 01:54:28PM +0100, Jan Kara wrote: > > Instead of storing backing_dev_info inside struct request_queue, > > allocate it dynamically, reference count it, and free it when the last > > reference is dropped. Currently only

Re: [PATCH 4/4] block: Make blk_get_backing_dev_info() safe without open bdev

2017-02-01 Thread Jan Kara
On Wed 01-02-17 01:53:20, Christoph Hellwig wrote: > Looks fine: > > Reviewed-by: Christoph Hellwig > > But can you also add another patch to kill off blk_get_backing_dev_info? > The direct dereference is short and cleaner. Additionally the bt_bdi > field in XFS could go away,

Re: [PATCH 7/8] mq-deadline: add blk-mq adaptation of the deadline IO scheduler

2017-02-01 Thread Paolo Valente
> Il giorno 17 dic 2016, alle ore 01:12, Jens Axboe ha scritto: > > This is basically identical to deadline-iosched, except it registers > as a MQ capable scheduler. This is still a single queue design. > > Signed-off-by: Jens Axboe > --- > block/Kconfig.iosched |

Re: [PATCH 4/4] block: Make blk_get_backing_dev_info() safe without open bdev

2017-02-01 Thread Christoph Hellwig
On Wed, Feb 01, 2017 at 01:28:14PM +0100, Jan Kara wrote: > OK, I'll do that. Another cleanup I was considering is to remove all other > embedded occurences of backing_dev_info and make the structure only > dynamically allocated. It would unify the handling of backing_dev_info and > allow us to

Re: [dm-devel] split scsi passthrough fields out of struct request V2

2017-02-01 Thread Jens Axboe
On 02/01/2017 08:46 AM, Bart Van Assche wrote: > On Tue, 2017-01-31 at 22:38 -0800, Jens Axboe wrote: >> I think this patch: >> >> http://git.kernel.dk/cgit/linux-block/commit/?h=for-4.11/block=12d70958a2e8d587acaa51dafd5d6620e00b7543 >> >> should fix it for you. I just ran into the same thing

Re: [dm-devel] split scsi passthrough fields out of struct request V2

2017-02-01 Thread Bart Van Assche
On Wed, 2017-02-01 at 09:13 -0800, Jens Axboe wrote: > On 02/01/2017 08:46 AM, Bart Van Assche wrote: > > Thanks for having looked into this. However, after having pulled the latest > > block for-next tree (dbb85b06229f) another lockup was triggered soon (02-sq > > is the name of a shell script of

[PATCH] block: Update comments that refer to __bio_map_user() and bio_map_user()

2017-02-01 Thread Bart Van Assche
Since __bio_map_user() and bio_map_user() have been removed, update the comments that still refer to these functions. Signed-off-by: Bart Van Assche References: commit ddad8dd0a162 ("block: use blk_rq_map_user_iov to implement blk_rq_map_user") Cc: Christoph Hellwig

Re: [dm-devel] split scsi passthrough fields out of struct request V2

2017-02-01 Thread Bart Van Assche
On Tue, 2017-01-31 at 22:38 -0800, Jens Axboe wrote: > I think this patch: > > http://git.kernel.dk/cgit/linux-block/commit/?h=for-4.11/block=12d70958a2e8d587acaa51dafd5d6620e00b7543 > > should fix it for you. I just ran into the same thing tonight, testing > an unrelated thing. It's the only

Re: [PATCH 3/4] blk-mq-debug: Make show() operations interruptible

2017-02-01 Thread Omar Sandoval
On Wed, Feb 01, 2017 at 10:20:58AM -0800, Bart Van Assche wrote: > Allow users to interrupt show operations instead of making a user > space process unkillable if ownership of q->sysfs_lock cannot be > obtained. Reviewed-by: Omar Sandoval > Signed-off-by: Bart Van Assche

Re: [PATCH 0/4] Four patches for the blk-mq debugfs code

2017-02-01 Thread Jens Axboe
On 02/01/2017 10:20 AM, Bart Van Assche wrote: > Hello Jens, > > Please consider the four patches in this series for kernel v4.11. Added, thanks Bart. -- Jens Axboe -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majord...@vger.kernel.org

Re: [PATCH] block: Update comments that refer to __bio_map_user() and bio_map_user()

2017-02-01 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 0/4] Four patches for the blk-mq debugfs code

2017-02-01 Thread Bart Van Assche
Hello Jens, Please consider the four patches in this series for kernel v4.11. Thanks, Bart. Bart Van Assche (4): blk-mq-debugfs: Add missing __acquires() / __releases() annotations blk-mq-debug: Avoid that sparse complains about req_flags_t usage blk-mq-debug: Make show() operations

[PATCH 4/4] blk-mq-debug: Introduce debugfs_create_files()

2017-02-01 Thread Bart Van Assche
Replace the two debugfs_create_file() loops by a call to the new debugfs_create_files() function. Add an empty element at the end of the two attribute arrays such that the array size does not have to be passed to debugfs_create_files(). Signed-off-by: Bart Van Assche

[PATCH 3/4] blk-mq-debug: Make show() operations interruptible

2017-02-01 Thread Bart Van Assche
Allow users to interrupt show operations instead of making a user space process unkillable if ownership of q->sysfs_lock cannot be obtained. Signed-off-by: Bart Van Assche Cc: Omar Sandoval --- block/blk-mq-debugfs.c | 34

[PATCH 2/4] blk-mq-debug: Avoid that sparse complains about req_flags_t usage

2017-02-01 Thread Bart Van Assche
Avoid that sparse reports the following complaints: block/elevator.c:541:29: warning: incorrect type in assignment (different base types) block/elevator.c:541:29:expected bool [unsigned] [usertype] next_sorted block/elevator.c:541:29:got restricted req_flags_t

[PATCH 1/4] blk-mq-debugfs: Add missing __acquires() / __releases() annotations

2017-02-01 Thread Bart Van Assche
This patch avoids that sparse complains about lock imbalances. Signed-off-by: Bart Van Assche Cc: Omar Sandoval --- block/blk-mq-debugfs.c | 4 1 file changed, 4 insertions(+) diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index

Re: [PATCH V2 1/3] blk-mq: allocate blk_mq_tags and requests in correct node

2017-02-01 Thread Jens Axboe
On 02/01/2017 09:53 AM, Shaohua Li wrote: > blk_mq_tags/requests of specific hardware queue are mostly used in > specific cpus, which might not be in the same numa node as disk. For > example, a nvme card is in node 0. half hardware queue will be used by > node 0, the other node 1. All three

Re: [PATCH 4/4] blk-mq-debug: Introduce debugfs_create_files()

2017-02-01 Thread Omar Sandoval
On Wed, Feb 01, 2017 at 10:20:59AM -0800, Bart Van Assche wrote: > Replace the two debugfs_create_file() loops by a call to the new > debugfs_create_files() function. Add an empty element at the end > of the two attribute arrays such that the array size does not have > to be passed to

Re: [dm-devel] split scsi passthrough fields out of struct request V2

2017-02-01 Thread Bart Van Assche
On Wed, 2017-02-01 at 09:13 -0800, Jens Axboe wrote: > So that's changing the elevator - did this happen while heavy IO was > going to the drive, or was it idle? I just ran into an I/O hang while running test 02-sq on top of kernel v4.9.6. I will have a closer look at the dm code to see whether I

Re: [PATCH V2 1/3] blk-mq: allocate blk_mq_tags and requests in correct node

2017-02-01 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH V2 2/3] PCI: add an API to get node from vector

2017-02-01 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH v2] scsi, block: fix duplicate bdi name registration crashes

2017-02-01 Thread Dan Williams
Warnings of the following form occur because scsi reuses a devt number while the block layer still has it referenced as the name of the bdi [1]: WARNING: CPU: 1 PID: 93 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x62/0x80 sysfs: cannot create duplicate filename '/devices/virtual/bdi/8:192' [..] Call

Re: [PATCH v2] scsi, block: fix duplicate bdi name registration crashes

2017-02-01 Thread Omar Sandoval
On Wed, Feb 01, 2017 at 11:32:12AM -0800, Dan Williams wrote: > Warnings of the following form occur because scsi reuses a devt number > while the block layer still has it referenced as the name of the bdi > [1]: > > WARNING: CPU: 1 PID: 93 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x62/0x80 > sysfs:

Re: [PATCH v2] scsi, block: fix duplicate bdi name registration crashes

2017-02-01 Thread Bart Van Assche
On Wed, 2017-02-01 at 11:32 -0800, Dan Williams wrote: > diff --git a/include/linux/genhd.h b/include/linux/genhd.h > index 76f39754e7b0..27e7e12c0c2d 100644 > --- a/include/linux/genhd.h > +++ b/include/linux/genhd.h > @@ -167,6 +167,22 @@ struct blk_integrity { > }; > > #endif /*

Re: [PATCH V2 3/3] nvme: allocate nvme_queue in correct node

2017-02-01 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 2/4] blk-mq-debug: Avoid that sparse complains about req_flags_t usage

2017-02-01 Thread Omar Sandoval
On Wed, Feb 01, 2017 at 10:20:57AM -0800, Bart Van Assche wrote: > Avoid that sparse reports the following complaints: > > block/elevator.c:541:29: warning: incorrect type in assignment (different > base types) > block/elevator.c:541:29:expected bool [unsigned] [usertype] next_sorted >

Re: [PATCH 4/4] block: Make blk_get_backing_dev_info() safe without open bdev

2017-02-01 Thread Dan Williams
On Tue, Jan 31, 2017 at 4:54 AM, Jan Kara wrote: > Currenly blk_get_backing_dev_info() is not safe to be called when the > block device is not open as bdev->bd_disk is NULL in that case. However > inode_to_bdi() uses this function and may be call called from flusher > worker or

Re: [PATCH] block: Update comments that refer to __bio_map_user() and bio_map_user()

2017-02-01 Thread Jens Axboe
On 02/01/2017 08:20 AM, Bart Van Assche wrote: > Since __bio_map_user() and bio_map_user() have been removed, update > the comments that still refer to these functions. Applied, thanks Bart. -- Jens Axboe -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of