Re: [PATCH V3 2/6] block: add centralize REQ_OP_XXX to string helper

2019-06-18 Thread Bart Van Assche
On 6/17/19 10:42 PM, Chaitanya Kulkarni wrote: +inline const char *blk_op_str(int op) +{ + const char *op_str = "UNKNOWN"; + + if (op < ARRAY_SIZE(blk_op_name) && blk_op_name[op]) + op_str = blk_op_name[op]; + + return op_str; +} This won't work correctly if op <

Re: [PATCH V3 1/6] block: improve print_req_error

2019-06-18 Thread Bart Van Assche
On 6/17/19 10:42 PM, Chaitanya Kulkarni wrote: From: Christoph Hellwig Print the calling function instead of print_req_error as a prefix, and print the operation and op_flags separately instead of the whole field. Signed-off-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig Is Christ

Re: [PATCH V2 0/7] block: use right accessor to read nr_setcs

2019-06-17 Thread Bart Van Assche
On 6/16/19 6:28 PM, Chaitanya Kulkarni wrote: Changes from V1:- 1. Drop the target_pscsi patch. (Bart) 2. Remove rcu locking which is not needed. (Bart) Chaitanya Kulkarni (7): block: add a helper function to read nr_setcs blk-zoned: update blkdev_nr_zones() with helper blk-zoned: upda

Re: [PATCH V2 1/7] block: add a helper function to read nr_setcs

2019-06-17 Thread Bart Van Assche
On 6/16/19 6:28 PM, Chaitanya Kulkarni wrote: This patch introduces helper function to read the number of sectors from struct block_device->bd_part member. For more details Please refer to the comment in the include/linux/genhd.h for part_nr_sects_read(). Signed-off-by: Chaitanya Kulkarni ---

Re: [PATCH V2 0/7] block: use right accessor to read nr_setcs

2019-06-17 Thread Bart Van Assche
On 6/16/19 6:28 PM, Chaitanya Kulkarni wrote: In the blk-zoned, bcache, f2fs and blktrace implementation block device->hd_part->number of sectors field is accessed directly without any appropriate locking or accessor function. There is an existing accessor function present in the in include/linux

Re: [PATCH V2 2/2] block: add more debug data to print_req_err

2019-06-13 Thread Bart Van Assche
On 6/13/19 9:53 AM, Martin K. Petersen wrote: Bart, If this patch gets applied there will be three copies in the upstream code that convert a REQ_OP_* constant into a string: one in blk-core.c, one in blk-mq-debugfs.c and one in include/trace/events/f2fs.h. Is it possible to avoid that duplica

Re: [COMPILE TESTED PATCH 6/8] target/pscsi: use helper in pscsi_get_blocks()

2019-06-13 Thread Bart Van Assche
On 6/13/19 7:59 AM, Chaitanya Kulkarni wrote: This patch updates the pscsi_get_blocks() with newly introduced helper function to read the nr_sects from block device's hd_parts with the help if part_nr_sects_read() protected by appropriate locking. Signed-off-by: Chaitanya Kulkarni --- drivers

Re: [PATCH 1/8] block: add a helper function to read nr_setcs

2019-06-13 Thread Bart Van Assche
On 6/13/19 7:59 AM, Chaitanya Kulkarni wrote: This patch introduces helper function to read the number of sectors from struct block_device->bd_part member. For more details Please refer to the comment in the include/linux/genhd.h for part_nr_sects_read(). Signed-off-by: Chaitanya Kulkarni ---

Re: [PATCH V2 2/2] block: add more debug data to print_req_err

2019-06-13 Thread Bart Van Assche
On 6/13/19 7:16 AM, Chaitanya Kulkarni wrote: +#define REQ_OP_NAME(name) [REQ_OP_##name] = #name +static const char *const op_name[] = { + REQ_OP_NAME(READ), + REQ_OP_NAME(WRITE), + REQ_OP_NAME(FLUSH), + REQ_OP_NAME(DISCARD), + REQ_OP_NAME(SECURE_ERASE), + REQ_

Re: [PATCH 2/2] block: add more debug data to print_req_err

2019-06-12 Thread Bart Van Assche
On 6/11/19 1:02 PM, Chaitanya Kulkarni wrote: +static inline const char *req_op_str(struct request *req) +{ + char *ret; + + switch (req_op(req)) { + case REQ_OP_READ: + ret = "read"; + break; + case REQ_OP_WRITE: + ret = "write";

Re: [PATCH 1/2] blk-mq: Remove blk_mq_put_ctx()

2019-06-10 Thread Bart Van Assche
On 6/8/19 1:19 AM, Christoph Hellwig wrote: On Tue, Jun 04, 2019 at 11:17:35AM -0700, Bart Van Assche wrote: No code that occurs between blk_mq_get_ctx() and blk_mq_put_ctx() depends on preemption being disabled for its correctness. Since removing the CPU preemption calls does not measurably

Re: [PATCH 3/6] block: remove the bi_phys_segments field in struct bio

2019-06-10 Thread Bart Van Assche
On 6/6/19 3:29 AM, Christoph Hellwig wrote: We only need the number of segments in the blk-mq submission path. Remove the field from struct bio, and return it from a variant of blk_queue_split instead of that it can passed as an argument to those functions that need the value. This also means we

[PATCH 0/2] Simplify blk-mq implementation

2019-06-04 Thread Bart Van Assche
Hi Jens, While reviewing the blk_mq_make_request() code I noticed that it is possible to simplify the implementation of that function. Please consider these patches for kernel v5.3. Thanks, Bart. Bart Van Assche (2): blk-mq: Remove blk_mq_put_ctx() blk-mq: Simplify blk_mq_make_request

[PATCH 2/2] blk-mq: Simplify blk_mq_make_request()

2019-06-04 Thread Bart Van Assche
Move the blk_mq_bio_to_request() call in front of the if-statement. Cc: Christoph Hellwig Cc: Ming Lei Cc: Hannes Reinecke Cc: Omar Sandoval Signed-off-by: Bart Van Assche --- block/blk-mq.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/block/blk-mq.c b

[PATCH 1/2] blk-mq: Remove blk_mq_put_ctx()

2019-06-04 Thread Bart Van Assche
preemption in blk_mq_get_ctx(). Cc: Christoph Hellwig Cc: Ming Lei Cc: Hannes Reinecke Cc: Omar Sandoval Signed-off-by: Bart Van Assche --- block/blk-mq-sched.c | 5 + block/blk-mq-tag.c| 8 block/blk-mq.c| 16 +++- block/blk-mq.h| 7

[PATCH] MAINTAINERS: Hand over skd maintainership

2019-06-03 Thread Bart Van Assche
Since I do no longer have access to any STEC SSDs, hand over maintainership of the skd driver to Damien who still has access to STEC SSDs. Cc: Damien Le Moal Cc: Bart Van Assche Cc: Christoph Hellwig Cc: Hannes Reinecke Signed-off-by: Bart Van Assche --- MAINTAINERS | 2 +- 1 file changed

Re: [PATCH] block :blk-sysfs: fix refcount imbalance on the error path

2019-06-03 Thread Bart Van Assche
On 6/3/19 12:46 AM, Lin Yi wrote: kobject_add takes a refcount to the object dev->kobj, but forget to release it on the error path, lead to a memory leak. Signed-off-by: Lin Yi --- block/blk-sysfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c ind

Re: [PATCH 2/9] block: null_blk: introduce module parameter of 'g_host_tags'

2019-05-31 Thread Bart Van Assche
On 5/30/19 7:27 PM, Ming Lei wrote: +static int g_host_tags = 0; Static variables should not be explicitly initialized to zero. +module_param_named(host_tags, g_host_tags, int, S_IRUGO); +MODULE_PARM_DESC(host_tags, "All submission queues share one tags");

Re: [PATCH 1/9] blk-mq: allow hw queues to share hostwide tags

2019-05-31 Thread Bart Van Assche
On 5/30/19 7:27 PM, Ming Lei wrote: diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index 6aea0ebc3a73..3d6780504dcb 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -237,6 +237,7 @@ static const char *const alloc_policy_name[] = { static const char *const hctx_f

[PATCH 4/8] block: Fix blk_mq_*_map_queues() kernel-doc headers

2019-05-30 Thread Bart Van Assche
queues") # v5.0. Signed-off-by: Bart Van Assche --- block/blk-mq-pci.c| 2 +- block/blk-mq-rdma.c | 4 ++-- block/blk-mq-virtio.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/block/blk-mq-pci.c b/block/blk-mq-pci.c index ad4545a2a98b..b595a94c4d16 100644 ---

[PATCH 5/8] block: Fix rq_qos_wait() kernel-doc header

2019-05-30 Thread Bart Van Assche
Add documentation for the @rqw argument and change " - " into ": ". Fixes: 84f603246db9 ("block: add rq_qos_wait to rq_qos") # v5.0-rc1~52^2~140. Signed-off-by: Bart Van Assche --- block/blk-rq-qos.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) dif

[PATCH 6/8] block: Fix bsg_setup_queue() kernel-doc header

2019-05-30 Thread Bart Van Assche
Document all bsg_setup_queue() arguments as required. Fixes: aae3b069d5ce ("bsg: pass in desired timeout handler") # v5.0. Signed-off-by: Bart Van Assche --- block/bsg-lib.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/bsg-lib.c b/block/bsg-lib.c index b898a1cdf872..78

[PATCH 7/8] blk-mq: Fix spelling in a source code comment

2019-05-30 Thread Bart Van Assche
Change one occurrence of 'performace' into 'performance'. Cc: Max Gurtovoy Fixes: fe631457ff3e ("blk-mq: map all HWQ also in hyperthreaded system") # v4.13. Signed-off-by: Bart Van Assche --- block/blk-mq-cpumap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 de

[PATCH 8/8] blk-mq: Document the blk_mq_hw_queue_to_node() arguments

2019-05-30 Thread Bart Van Assche
Document the meaning of the blk_mq_hw_queue_to_node() arguments. Signed-off-by: Bart Van Assche --- block/blk-mq-cpumap.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/block/blk-mq-cpumap.c b/block/blk-mq-cpumap.c index 0afa4dc48365..f945621a0e8f 100644 --- a/block

[PATCH 2/8] block: Convert blk_invalidate_devt() header into a non-kernel-doc header

2019-05-30 Thread Bart Van Assche
This patch avoids that the kernel-doc tool warns about this function header when building with W=1. Signed-off-by: Bart Van Assche --- block/genhd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/genhd.c b/block/genhd.c index ad6826628e79..24654e1d83e6 100644

[PATCH 3/8] block: Fix throtl_pending_timer_fn() kernel-doc header

2019-05-30 Thread Bart Van Assche
Commit e99e88a9d2b0 renamed a function argument without updating the corresponding kernel-doc header. Update the kernel-doc header. Cc: Kees Cook Fixes: e99e88a9d2b0 ("treewide: setup_timer() -> timer_setup()") # v4.15. Signed-off-by: Bart Van Assche --- block/blk-throttle.c |

[PATCH 0/8] Improve block layer function documentation

2019-05-30 Thread Bart Van Assche
Hi Jens, This is a series with eight patches that address source code comments. Most patches suppress kernel-doc warnings that appear when building with W=1. Please consider these patches. Thanks, Bart. Bart Van Assche (8): block/partitions/ldm: Convert a kernel-doc header into a non

[PATCH 1/8] block/partitions/ldm: Convert a kernel-doc header into a non-kernel-doc header

2019-05-30 Thread Bart Van Assche
This patch avoids that the kernel-doc tool warns about this function header when building with W=1. Signed-off-by: Bart Van Assche --- block/partitions/ldm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/partitions/ldm.c b/block/partitions/ldm.c index 6db573f33219

Re: [PATCH 0/2] Reset timeout for paused hardware

2019-05-23 Thread Bart Van Assche
On 5/22/19 10:28 PM, Keith Busch wrote: > On Wed, May 22, 2019 at 10:20:45PM +0200, Bart Van Assche wrote: >> On 5/22/19 7:48 PM, Keith Busch wrote: >>> Hardware may temporarily stop processing commands that have >>> been dispatched to it while activatin

Re: [PATCH 0/2] Reset timeout for paused hardware

2019-05-22 Thread Bart Van Assche
On 5/22/19 7:48 PM, Keith Busch wrote: > Hardware may temporarily stop processing commands that have > been dispatched to it while activating new firmware. Some target > implementation's paused state time exceeds the default request expiry, > so any request dispatched before the driver could quiesc

Re: [RFC PATCH 01/18] blktrace: increase the size of action mask

2019-05-02 Thread Bart Van Assche
On Thu, 2019-05-02 at 03:43 +, Chaitanya Kulkarni wrote: > On 5/1/19 8:48 AM, Bart Van Assche wrote: > > On Tue, 2019-04-30 at 21:28 -0700, Chaitanya Kulkarni wrote: > > > -#define BLKTRACESETUP32 _IOWR(0x12, 115, struct > > > compat_blk_user_trace_setup) >

Re: [RFC PATCH 01/18] blktrace: increase the size of action mask

2019-05-01 Thread Bart Van Assche
On Tue, 2019-04-30 at 21:28 -0700, Chaitanya Kulkarni wrote: > -#define BLKTRACESETUP32 _IOWR(0x12, 115, struct compat_blk_user_trace_setup) > + > +/* XXX: temp work around for RFC */ > +#define BLKTRACESETUP32 _IOWR(0x13, 115, struct compat_blk_user_trace_setup) This change breaks user space so t

Re: [PATCH v4] blk-mq: fix hang caused by freeze/unfreeze sequence

2019-04-29 Thread Bart Van Assche
On Thu, 2019-04-25 at 03:28 -0700, Bob Liu wrote: > The following is a description of a hang in blk_mq_freeze_queue_wait(). > The hang happens on attempting to freeze a queue while another task does > queue unfreeze. Reviewed-by: Bart Van Assche

Re: [PATCH] block: use static bio_set for bio_split() calls

2019-04-24 Thread Bart Van Assche
On Thu, 2019-04-18 at 16:06 +0200, Hannes Reinecke wrote: > +static int __init blk_bio_split_init(void) > +{ > + return bioset_init(&bio_split_bio_set, BIO_POOL_SIZE, 0, > + BIOSET_NEED_BVECS); > +} The slab allocator uses __init for some of its initialization. Can i

Re: [PATCH v3] block: fix use-after-free on gendisk

2019-04-15 Thread Bart Van Assche
> get_gendisk(). > > We fix this by adding a new helper blk_invalidate_devt() in > delete_partition() and del_gendisk(). It replaces hd_struct > pointer in idr with value 'NULL', and deletes the entry from > idr in part_release() as we do now. > > Thanks to Jan Kara for providing the solution and more clear comments > for the code. Nice work. Reviewed-by: Bart Van Assche

Re: [PATCH v3] block: fix use-after-free on gendisk

2019-04-15 Thread Bart Van Assche
On Tue, 2019-04-02 at 20:06 +0800, Yufen Yu wrote: > diff --git a/block/genhd.c b/block/genhd.c > index 961b2bc4634f..a4ef0068dbb2 100644 > --- a/block/genhd.c > +++ b/block/genhd.c > @@ -529,6 +529,18 @@ void blk_free_devt(dev_t devt) > } > } > > +/** > + * We invalidate devt by ass

Re: [PATCH 3/5] block: don't allow multiple bio_iov_iter_get_pages calls per bio

2019-04-12 Thread Bart Van Assche
bit. Reviewed-by: Bart Van Assche

Re: [PATCH v2] fs/block_dev.c: remove unused include

2019-04-09 Thread Bart Van Assche
On Tue, 2019-04-09 at 18:37 +0800, Chengguang Xu wrote: > Just remove unused include from > fs/block_dev.c. Reviewed-by: Bart Van Assche

Re: [PATCH] block: Revert v5.0 blk_mq_request_issue_directly() changes

2019-04-09 Thread Bart Van Assche
On 4/8/19 10:13 PM, Stewart Smith wrote: At least when this patch is cherry-picked back on top of 5.0.7, it doesn't seem to fully fix the problem for us (which is ppc64le). We hit this at some point while eudev is finding disks and we have a process mounting them to see what's there: cpu 0x4a: V

Re: [PATCH 3/5] block: don't allow multiple bio_iov_iter_get_pages calls per bio

2019-04-08 Thread Bart Van Assche
On Mon, 2019-04-08 at 12:46 +0200, Christoph Hellwig wrote: > No caller uses bio_iov_iter_get_pages multiple times on a given bio, > and that funtionality isn't all that useful. Removing it will make > some future changes a little easier and also simplifies the function > a bit. > > Signed-off-by

Re: [PATCH 2/5] block: refactor __bio_iov_bvec_add_pages

2019-04-08 Thread Bart Van Assche
On Mon, 2019-04-08 at 12:46 +0200, Christoph Hellwig wrote: > Return early on error, and add an unlikely annotation for that case. Reviewed-by: Bart Van Assche

Re: [PATCH 1/5] block: rewrite blk_bvec_map_sg to avoid a nth_page call

2019-04-08 Thread Bart Van Assche
On Mon, 2019-04-08 at 12:46 +0200, Christoph Hellwig wrote: > The offset in scatterlists is allowed to be larger than the page size, > so don't go to great length to avoid that case and simplify the > arithmetics. Reviewed-by: Bart Van Assche

Re: [PATCH] fs/block_dev.c: remove unused header file badblocks.h

2019-04-08 Thread Bart Van Assche
On Mon, 2019-04-08 at 18:33 +0800, Chengguang Xu wrote: > This patch just removes unused header file badblocks.h > from fs/block_dev.c > > Signed-off-by: Chengguang Xu > --- > fs/block_dev.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/fs/block_dev.c b/fs/block_dev.c > index 78d32574

Re: [PATCH] block: cleanup for blk_cleanup_queue()

2019-04-07 Thread Bart Van Assche
On 4/7/19 4:03 AM, Shenghui Wang wrote: /* -* Drain all requests queued before DYING marking. Set DEAD flag to +* Drain all requests queued before DEAD marking. Set DEAD flag to * prevent that q->request_fn() gets invoked after draining finished. */ No

Re: [PATCH] block: Revert v5.0 blk_mq_request_issue_directly() changes

2019-04-05 Thread Bart Van Assche
On 4/4/19 11:06 PM, Christoph Hellwig wrote: On Thu, Apr 04, 2019 at 10:08:43AM -0700, Bart Van Assche wrote: blk_mq_try_issue_directly() can return BLK_STS*_RESOURCE for requests that have been queued. If that happens when blk_mq_try_issue_directly() is called by the dm-mpath driver then dm

Re: [PATCH] block: Revert v5.0 blk_mq_request_issue_directly() changes

2019-04-05 Thread Bart Van Assche
On 4/5/19 5:43 AM, Laurence Oberman wrote: On Fri, 2019-04-05 at 08:06 +0200, Christoph Hellwig wrote: On Thu, Apr 04, 2019 at 10:08:43AM -0700, Bart Van Assche wrote: blk_mq_try_issue_directly() can return BLK_STS*_RESOURCE for requests that have been queued. If that happens when

Re: [PATCH] block: Revert v5.0 blk_mq_request_issue_directly() changes

2019-04-04 Thread Bart Van Assche
On Fri, 2019-04-05 at 05:43 +0800, Ming Lei wrote: > On Thu, Apr 04, 2019 at 10:08:43AM -0700, Bart Van Assche wrote: > > blk_mq_try_issue_directly() can return BLK_STS*_RESOURCE for requests that > > have been queued. If that happens when blk_mq_try_issue_directly() is called >

Re: [PATCH] block: Fix blk_mq_try_issue_directly()

2019-04-04 Thread Bart Van Assche
On Thu, 2019-04-04 at 12:47 -0400, Laurence Oberman wrote: > I can conform, reverting those 3 in order also resolves the panic I was > seeing. I have 3 reboot tests of the srpt server allowing the client ot > remain stable and try reconnect. > > For the above patch: > Tested-by: Laurence Oberman

[PATCH] block: Revert v5.0 blk_mq_request_issue_directly() changes

2019-04-04 Thread Bart Van Assche
Cc: Laurence Oberman Cc: Reported-by: Laurence Oberman Tested-by: Laurence Oberman Fixes: 7f556a44e61d ("blk-mq: refactor the code of issue request directly") # v5.0. Signed-off-by: Bart Van Assche --- block/blk-core.c | 4 +- block/bl

Re: [PATCH] block: Fix blk_mq_try_issue_directly()

2019-04-04 Thread Bart Van Assche
x27; in blk_mq_sched_insert_requests") # v5.0. * 7f556a44e61d ("blk-mq: refactor the code of issue request directly") # v5.0. Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: James Smart Cc: Ming Lei Cc: Jianchao Wang Cc: Keith Busch Cc: Dongli Zhang Cc: Laurence Oberman Cc:

Re: [PATCH] block: Fix blk_mq_try_issue_directly()

2019-04-04 Thread Bart Van Assche
On Thu, 2019-04-04 at 15:08 +0800, Ming Lei wrote: > On Wed, Apr 03, 2019 at 01:11:26PM -0700, Bart Van Assche wrote: > > If blk_mq_try_issue_directly() returns BLK_STS*_RESOURCE that means that > > the request has not been queued and that the caller should retry to submit > &

[PATCH] block: Fix blk_mq_try_issue_directly()

2019-04-03 Thread Bart Van Assche
Reviewed-by: Laurence Oberman Reported-by: Laurence Oberman Fixes: 7f556a44e61d ("blk-mq: refactor the code of issue request directly") # v5.0. Cc: Signed-off-by: Bart Van Assche --- block/blk-mq.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/block/blk-mq

Re: [PATCH v2] block: don't show io_timeout if driver has no timeout handler

2019-04-03 Thread Bart Van Assche
On Tue, 2019-04-02 at 21:14 +0800, Weiping Zhang wrote: > If the low level driver has no timeout handler, the > /sys/block//queue/io_timeout will not be displayed. Reviewed-by: Bart Van Assche

Re: [PATCH v2] block: don't show io_timeout if driver has no timeout handler

2019-04-03 Thread Bart Van Assche
On Wed, 2019-04-03 at 18:48 +0800, Weiping Zhang wrote: > Could you point out the race case for udev? Hi Weiping, A quote from Documentation/kobject.txt: "Use the KOBJ_ADD action for when the kobject is first added to the kernel. This should be done only after any attributes or children of the k

Re: [PATCH] block: bio: ensure newly added bio flags don't override BVEC_POOL_IDX

2019-04-03 Thread Bart Van Assche
d thus overrides the BVEC_POOL_IDX > causing crashes. Reviewed-by: Bart Van Assche

Re: [PATCH] block: Fix a race between tag iteration and hardware queue changes

2019-04-03 Thread Bart Van Assche
On Wed, 2019-04-03 at 11:26 +0800, jianchao.wang wrote: > percpu_ref_tryget should be enough here. Having thought further about this, I think you are right. I will drop this patch. Thanks, Bart.

Re: [PATCH] block: Fix a race between tag iteration and hardware queue changes

2019-04-02 Thread Bart Van Assche
On 4/2/19 6:02 PM, Dongli Zhang wrote: I used to see the removal of above in one of Jianchao's patchset. https://lore.kernel.org/patchwork/patch/1051047/ Thanks for the feedback. But it seems like the q->mq_freeze_depth test is missing from Jianchao's patch ... Bart.

[PATCH] block: Fix a race between tag iteration and hardware queue changes

2019-04-02 Thread Bart Van Assche
v4.19. Signed-off-by: Bart Van Assche --- block/blk-mq-tag.c | 10 +- block/blk-mq.c | 5 + 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index a4931fc7be8a..89f479634b4d 100644 --- a/block/blk-mq-tag.c +++ b/block

Re: [PATCH 2/4] block: Fix a race between request queue freezing and running queues

2019-04-02 Thread Bart Van Assche
On Tue, 2019-04-02 at 08:53 +0800, Ming Lei wrote: > On Mon, Apr 01, 2019 at 02:20:12PM -0700, Bart Van Assche wrote: > > diff --git a/block/blk-mq.c b/block/blk-mq.c > > index 3ff3d7b49969..652d0c6d5945 100644 > > --- a/block/blk-mq.c > > +++ b/block/blk-mq.c >

Re: [PATCH v2] block: don't show io_timeout if driver has no timeout handler

2019-04-02 Thread Bart Van Assche
On Tue, 2019-04-02 at 21:14 +0800, Weiping Zhang wrote: > [ ... ] > -static struct attribute *default_attrs[] = { > +static struct attribute *queue_attrs[] = { > &queue_requests_entry.attr, > &queue_ra_entry.attr, > &queue_max_hw_sectors_entry.attr, > @@ -770,6 +770,25 @@ static s

Re: [PATCH] block: don't show io_timeout if driver has no timeout handler

2019-04-01 Thread Bart Van Assche
On Sun, 2019-03-31 at 23:28 +0800, weiping zhang wrote: > On Tue, Jan 08, 2019 at 04:57:40PM -0800, Bart Van Assche wrote: > > > @@ -942,6 +961,14 @@ int blk_register_queue(struct gendisk *disk) > > > goto unlock; > > > } > > > &g

[PATCH 3/4] block: Fix a comment in blk_cleanup_queue()

2019-04-01 Thread Bart Van Assche
Change a reference to the legacy block layer into a reference to blk-mq. Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: James Smart Cc: Ming Lei Cc: Jianchao Wang Cc: Dongli Zhang Cc: Signed-off-by: Bart Van Assche --- block/blk-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion

[PATCH 2/4] block: Fix a race between request queue freezing and running queues

2019-04-01 Thread Bart Van Assche
d7c73 ("block: Fix a race between request queue removal and the block cgroup controller") # v4.17. Reported-by: James Smart Signed-off-by: Bart Van Assche --- block/blk-mq.c | 8 1 file changed, 8 insertions(+) diff --git a/block/blk-mq.c b/block/blk-mq.c index 3ff3d7b49969..

[PATCH 1/4] block: Move the percpu_ref_exit(&q->q_usage_counter) call into __blk_release_queue()

2019-04-01 Thread Bart Van Assche
Cc: Signed-off-by: Bart Van Assche --- block/blk-core.c | 2 -- block/blk-sysfs.c | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 4673ebe42255..fdcf6de2243f 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -377,8 +377,6

[PATCH 4/4] block: Make blk_cleanup_queue() faster

2019-04-01 Thread Bart Van Assche
oph Hellwig Cc: Hannes Reinecke Cc: James Smart Cc: Ming Lei Cc: Jianchao Wang Cc: Dongli Zhang Cc: Signed-off-by: Bart Van Assche --- block/blk-core.c | 12 1 file changed, 12 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index bfdbdbb8ec65..2921af6f8d33

[PATCH 0/4] Fir a race between request queue cleanup and running queues

2019-04-01 Thread Bart Van Assche
Hi Jens, This patch series fixes a recently reported race between request queue cleanup and running request queues. The approach followed is not to run the queue anymore after a request queue has been marked "dead". Please consider this patch series for kernel v5.1. Thanks, Bart.

Re: [PATCH] block: don't call blk_mq_run_hw_queues() for dead or dying queues

2019-03-26 Thread Bart Van Assche
On Tue, 2019-03-26 at 15:08 +0100, Hannes Reinecke wrote: > On 3/26/19 2:43 PM, Bart Van Assche wrote: > > On 3/26/19 5:07 AM, Hannes Reinecke wrote: > > > When a queue is dying or dead there is no point in calling > > > blk_mq_run_hw_queues() in blk_mq_unquiesce_queue

Re: [PATCH] block: don't call blk_mq_run_hw_queues() for dead or dying queues

2019-03-26 Thread Bart Van Assche
On 3/26/19 5:07 AM, Hannes Reinecke wrote: When a queue is dying or dead there is no point in calling blk_mq_run_hw_queues() in blk_mq_unquiesce_queue(); in fact, doing so might crash the machine as the queue structures are in the process of being deleted. Signed-off-by: Hannes Reinecke --- b

Re: [PATCH] blk-mq: fix sbitmap ws_active for shared tags

2019-03-25 Thread Bart Van Assche
On Mon, 2019-03-25 at 10:22 -0600, Jens Axboe wrote: > We now wrap sbitmap waitqueues in an active counter, so we can avoid > iterating wakeups unless we have waiters there. This works as long as > everyone that's manipulating the waitqueues use the proper helpers. For > the tag wait case for share

Re: Read data to kernel buffer by blkdev_read_iter

2019-03-22 Thread Bart Van Assche
On Fri, 2019-03-22 at 17:57 +0300, Ivan Safonov wrote: > In the previous message I misled you: iov_iter has ITER_KVEC type only > if set_fs(get_ds()) present before iov_iter_init(). In this case > _without_ IOCB_DIRECT blkdev_read_iter() work fine. With IOCB_DIRECT > blkdev_read_iter() return -E

Re: Read data to kernel buffer by blkdev_read_iter

2019-03-22 Thread Bart Van Assche
On 3/22/19 6:06 AM, Ivan Safonov wrote: Kernel version is 4.19.16. Is this behavior valid for iov_iter with type ITER_KVEC? Are you familiar with the ITER_KVEC flag? Bart.

Re: [PATCH 1/2] blk-mq: introduce blk_mq_complete_request_sync()

2019-03-20 Thread Bart Van Assche
On 3/20/19 5:47 PM, Sagi Grimberg wrote: If I understand the race correctly, its not between the requests completion and the queue pairs removal nor the timeout handler necessarily, but rather it is between the async requests completion and the tagset deallocation. Think of surprise removal (or

[PATCH] blkcg: Fix kernel-doc warnings

2019-03-20 Thread Bart Van Assche
#x27; block/blk-cgroup.c:1779: warning: Function parameter or member 'delta' not described in 'blkcg_add_delay' Signed-off-by: Bart Van Assche --- block/blk-cgroup.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c

[PATCH] blk-iolatency: #include "blk.h"

2019-03-20 Thread Bart Van Assche
) # v4.19 Signed-off-by: Bart Van Assche --- block/blk-iolatency.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c index 2620baa1f699..507212d75ee2 100644 --- a/block/blk-iolatency.c +++ b/block/blk-iolatency.c @@ -75,6 +75,7 @@ #include #i

[PATCH] block: Unexport blk_mq_add_to_requeue_list()

2019-03-20 Thread Bart Van Assche
This function is not used outside the block layer core. Hence unexport it. Cc: Christoph Hellwig Cc: Ming Lei Signed-off-by: Bart Van Assche --- block/blk-mq.c | 1 - block/blk-mq.h | 2 ++ include/linux/blk-mq.h | 2 -- 3 files changed, 2 insertions(+), 3 deletions(-) diff

Re: [PATCH V2] sbitmap: order READ/WRITE freed instance and setting clear bit

2019-03-19 Thread Bart Van Assche
On Tue, 2019-03-19 at 16:38 +0800, Ming Lei wrote: > Inside sbitmap_queue_clear(), once the clear bit is set, it will be > visiable to allocation path immediately. Meantime READ/WRITE on old > associated instance(such as request in case of blk-mq) may be > out-of-order with the setting clear bit, s

Re: [PATCH 1/2] blk-mq: introduce blk_mq_complete_request_sync()

2019-03-18 Thread Bart Van Assche
On Mon, 2019-03-18 at 23:16 +0800, Ming Lei wrote: > I am not familiar with SRP, could you explain what SRP initiator driver > will do when the controller is in bad state? Especially about dealing with > in-flight IO requests under this situation. Hi Ming, Just like the NVMeOF initiator driver, t

Re: [PATCH 1/2] blk-mq: introduce blk_mq_complete_request_sync()

2019-03-18 Thread Bart Van Assche
On Mon, 2019-03-18 at 15:38 +0800, Ming Lei wrote: > On Sun, Mar 17, 2019 at 09:09:09PM -0700, Bart Van Assche wrote: > > On 3/17/19 8:29 PM, Ming Lei wrote: > > > In NVMe's error handler, follows the typical steps for tearing down > > > hardware: > > >

Re: [PATCH 1/2] blk-mq: introduce blk_mq_complete_request_sync()

2019-03-17 Thread Bart Van Assche
On 3/17/19 8:29 PM, Ming Lei wrote: In NVMe's error handler, follows the typical steps for tearing down hardware: 1) stop blk_mq hw queues 2) stop the real hw queues 3) cancel in-flight requests via blk_mq_tagset_busy_iter(tags, cancel_request, ...) cancel_request(): mark the req

Re: [PATCH 4/5] nvme: Fail dead namespace's entered requests

2019-03-08 Thread Bart Van Assche
On Fri, 2019-03-08 at 11:19 -0700, Keith Busch wrote: > On Fri, Mar 08, 2019 at 10:15:27AM -0800, Bart Van Assche wrote: > > On Fri, 2019-03-08 at 10:40 -0700, Keith Busch wrote: > > > End the entered requests on a quieced queue directly rather than flush > > > them thr

Re: [PATCH 1/5] blk-mq: Export reading mq request state

2019-03-08 Thread Bart Van Assche
On Fri, 2019-03-08 at 14:14 -0700, Keith Busch wrote: > On Fri, Mar 08, 2019 at 12:47:10PM -0800, Bart Van Assche wrote: > > If no such mechanism has been defined in the NVMe spec: have you considered > > to cancel all outstanding requests instead of calling blk_mq_end_request()

Re: [PATCH 1/5] blk-mq: Export reading mq request state

2019-03-08 Thread Bart Van Assche
On Fri, 2019-03-08 at 12:19 -0700, Keith Busch wrote: > On Fri, Mar 08, 2019 at 10:42:17AM -0800, Bart Van Assche wrote: > > I think that the NVMe spec provides a more elegant mechanism, > > namely deleting the I/O submission queues. According to what I read in the > > 1.3c

Re: [PATCH 1/5] blk-mq: Export reading mq request state

2019-03-08 Thread Bart Van Assche
On Fri, 2019-03-08 at 11:15 -0700, Keith Busch wrote: > On Fri, Mar 08, 2019 at 10:07:23AM -0800, Bart Van Assche wrote: > > On Fri, 2019-03-08 at 10:40 -0700, Keith Busch wrote: > > > Drivers may need to know the state of their requets. > > > > Hi Keith, >

Re: [PATCH 5/5] nvme/pci: Remove queue IO flushing hack

2019-03-08 Thread Bart Van Assche
On Fri, 2019-03-08 at 10:40 -0700, Keith Busch wrote: > +static bool nvme_fail_queue_request(struct request *req, void *data, bool > reserved) > +{ > + struct nvme_iod *iod = blk_mq_rq_to_pdu(req); > + struct nvme_queue *nvmeq = iod->nvmeq; > + > + if (!test_bit(NVMEQ_ENABLED, &nvmeq->

Re: [PATCH 4/5] nvme: Fail dead namespace's entered requests

2019-03-08 Thread Bart Van Assche
On Fri, 2019-03-08 at 10:40 -0700, Keith Busch wrote: > End the entered requests on a quieced queue directly rather than flush > them through the low level driver's queue_rq(). > > Signed-off-by: Keith Busch > --- > drivers/nvme/host/core.c | 10 -- > 1 file changed, 8 insertions(+), 2 d

Re: [PATCH 2/5] blk-mq: Export iterating queue requests

2019-03-08 Thread Bart Van Assche
On Fri, 2019-03-08 at 10:40 -0700, Keith Busch wrote: > A driver may need to iterate a particular queue's tagged request rather > than the whole tagset. Since iterating over requests triggers race conditions with request execution please explain what use case(s) you have in mind and what your plan

Re: [PATCH 1/5] blk-mq: Export reading mq request state

2019-03-08 Thread Bart Van Assche
On Fri, 2019-03-08 at 10:40 -0700, Keith Busch wrote: > Drivers may need to know the state of their requets. Hi Keith, What makes you think that drivers should be able to check the state of their requests? Please elaborate. > diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h > index f

Re: [RFC/PATCH net-next 0/9] net/dim: Support for multiple implementations

2019-03-06 Thread Bart Van Assche
On Wed, 2019-03-06 at 10:48 +0200, Tal Gilboa wrote: > net_dim.h lib exposes an implementation of the DIM algorithm for > dynamically-tuned interrupt > moderation for networking interfaces. > > We need the same behavior for any block CQ. The main motivation is two > benefit from maximized > comp

Re: [dm-devel] [PATCH V15 00/18] block: support multi-page bvec

2019-02-19 Thread Bart Van Assche
On 2/19/19 5:17 PM, Ming Lei wrote: On Tue, Feb 19, 2019 at 08:28:19AM -0800, Bart Van Assche wrote: With this patch applied test nvmeof-mp/002 fails as follows: [ 694.700400] kernel BUG at lib/sg_pool.c:103! [ 694.705932] invalid opcode: [#1] PREEMPT SMP KASAN [ 694.708297] CPU: 2 PID

Re: v4.20-rc6: Sporadic use-after-free in bt_iter()

2019-02-19 Thread Bart Van Assche
On Fri, 2019-02-15 at 10:29 -0800, Evan Green wrote: > I got all turned around while trying to understand this fix, and I'll > admit it's probably just me. It looks like you're trying to use an rcu > lock to prevent the iter functions from racing with free. Is that > true? But then the race at leas

Re: [dm-devel] [PATCH V15 00/18] block: support multi-page bvec

2019-02-19 Thread Bart Van Assche
On Sun, 2019-02-17 at 21:11 +0800, Ming Lei wrote: > The following patch should fix this issue: > > > diff --git a/block/blk-merge.c b/block/blk-merge.c > index bed065904677..066b66430523 100644 > --- a/block/blk-merge.c > +++ b/block/blk-merge.c > @@ -363,13 +363,15 @@ static unsigned int __blk_

Re: [PATCH BLKTESTS 3/3] nvme/017: fix output format

2019-02-19 Thread Bart Van Assche
On Mon, 2019-02-18 at 10:53 -0800, Chaitanya Kulkarni wrote: > Signed-off-by: Chaitanya Kulkarni > --- > tests/nvme/017 | 5 - > tests/nvme/017.out | 11 --- > 2 files changed, 4 insertions(+), 12 deletions(-) > > diff --git a/tests/nvme/017 b/tests/nvme/017 > index 0b86bec..db8

Re: [LSF/MM TOPIC] NVMe Performance: Userspace vs Kernel

2019-02-15 Thread Bart Van Assche
On Sat, 2019-02-16 at 00:53 +, Felipe Franciosi wrote: > On Feb 15, 2019, at 9:41 PM, Bart Van Assche wrote: > > On Fri, 2019-02-15 at 21:19 +-, Felipe Franciosi wrote: > > > Hi All, > > > > > > I'd like to attend LSF/MM this year and discuss the

Re: [LSF/MM TOPIC] NVMe Performance: Userspace vs Kernel

2019-02-15 Thread Bart Van Assche
On Fri, 2019-02-15 at 21:19 +, Felipe Franciosi wrote: > Hi All, > > I'd like to attend LSF/MM this year and discuss the kernel performance when > accessing NVMe devices, specifically (but not limited to) Intel Optane Memory > (which boasts very low latency and high > iops/throughput per NVM

Re: [dm-devel] [PATCH V15 00/18] block: support multi-page bvec

2019-02-15 Thread Bart Van Assche
On Fri, 2019-02-15 at 08:49 -0700, Jens Axboe wrote: > On 2/15/19 4:13 AM, Ming Lei wrote: > > This patchset brings multi-page bvec into block layer: > > Applied, thanks Ming. Let's hope it sticks! Hi Jens and Ming, Test nvmeof-mp/002 fails with Jens' for-next branch from this morning. I have no

Re: v4.20-rc6: Sporadic use-after-free in bt_iter()

2019-02-14 Thread Bart Van Assche
On Thu, 2018-12-20 at 15:50 -0700, Jens Axboe wrote: > +static void blk_fq_rcu_free(struct work_struct *work) > +{ > + struct blk_flush_queue *fq = container_of(to_rcu_work(work), > + struct blk_flush_queue, > +

Re: [LSF/MM TOPIC] improving storage testing

2019-02-14 Thread Bart Van Assche
On Thu, 2019-02-14 at 11:55 +0100, Johannes Thumshirn wrote: > On Wed, Feb 13, 2019 at 01:07:54PM -0500, Theodore Y. Ts'o wrote: > > Also, there are expectations about minimum versions of bash that can > > be supported; but there aren't necessarily for other components such > > as nvme-cli, and I s

Re: KASAN warning in bt_for_each

2019-02-14 Thread Bart Van Assche
On Thu, 2019-02-14 at 13:50 -0700, Jens Axboe wrote: > On 2/14/19 1:45 PM, Evan Green wrote: > > On Thu, Feb 14, 2019 at 11:33 AM Bart Van Assche wrote: > > > > > > On Thu, 2019-02-14 at 10:04 -0800, Evan Green wrote: > > > > Greetings, block experts! >

Re: KASAN warning in bt_for_each

2019-02-14 Thread Bart Van Assche
On Thu, 2019-02-14 at 10:04 -0800, Evan Green wrote: > Greetings, block experts! > > I'm trying to track down a KASAN warning I'm seeing in our downstream > 4.19 kernel, and I could use a little help. The warning looks like > this: > > [ 224.564894] BUG: KASAN: use-after-free in bt_for_each+0x1a

Re: [LSF/MM TOPIC] : blktests: status, an expansion plan for the storage stack test framework

2019-02-13 Thread Bart Van Assche
On Wed, 2019-02-13 at 11:56 -0800, Omar Sandoval wrote: > On Wed, Feb 13, 2019 at 10:54:04AM -0800, Bart Van Assche wrote: > > What is a build status badge? > > I just added it, see > https://github.com/osandov/blktests/commit/a61aa7fcce0bad9094b0e7646f3a8299c30afa6a > >

<    1   2   3   4   5   6   7   8   9   10   >