Re: [dm-devel] [PATCH] multipathd: avoid crash in uevent_cleanup()

2021-03-18 Thread lixiaokeng
On 2021/3/18 0:59, Martin Wilck wrote: > Hello Lixiaokeng, > > >> Hi Martin >> >>   I'm sorry for missing this. 38ffd89 ("libmultipath: prevent >> DSO unloading with astray checker threads") fixes my issue. > > Thanks! Am I right assuming that you did _not_ use my prior patch > "multipathd:

Re: [dm-devel] [RFC PATCH V2 09/13] block: use per-task poll context to implement bio based io poll

2021-03-18 Thread Ming Lei
On Thu, Mar 18, 2021 at 01:26:22PM -0400, Mike Snitzer wrote: > On Thu, Mar 18 2021 at 12:48pm -0400, > Ming Lei wrote: > > > Currently bio based IO poll needs to poll all hw queue blindly, this way > > is very inefficient, and the big reason is that we can't pass bio > > submission result to io

Re: [dm-devel] [PATCH v7 2/3] block: add bdev_interposer

2021-03-18 Thread Sergei Shtepa
The 03/17/2021 22:13, Mike Snitzer wrote: > On Wed, Mar 17 2021 at 2:14pm -0400, > Sergei Shtepa wrote: > > > The 03/17/2021 18:04, Mike Snitzer wrote: > > > On Wed, Mar 17 2021 at 8:22am -0400, > > > Sergei Shtepa wrote: > > > > > > > The 03/17/2021 06:03, Ming Lei wrote: > > > > > On Tue,

Re: [dm-devel] [RFC PATCH V2 09/13] block: use per-task poll context to implement bio based io poll

2021-03-18 Thread Mike Snitzer
On Thu, Mar 18, 2021 at 1:26 PM Mike Snitzer wrote: > > On Thu, Mar 18 2021 at 12:48pm -0400, > Ming Lei wrote: > > > Currently bio based IO poll needs to poll all hw queue blindly, this way > > is very inefficient, and the big reason is that we can't pass bio > > submission result to io poll

Re: [dm-devel] [RFC PATCH V2 09/13] block: use per-task poll context to implement bio based io poll

2021-03-18 Thread Mike Snitzer
On Thu, Mar 18 2021 at 12:48pm -0400, Ming Lei wrote: > Currently bio based IO poll needs to poll all hw queue blindly, this way > is very inefficient, and the big reason is that we can't pass bio > submission result to io poll task. > > In IO submission context, track associated underlying

[dm-devel] [RFC PATCH V2 07/13] block/mq: extract one helper function polling hw queue

2021-03-18 Thread Ming Lei
From: Jeffle Xu Extract the logic of polling one hw queue and related statistics handling out as the helper function. Signed-off-by: Jeffle Xu Signed-off-by: Ming Lei --- block/blk-mq.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/block/blk-mq.c

[dm-devel] [RFC PATCH V2 09/13] block: use per-task poll context to implement bio based io poll

2021-03-18 Thread Ming Lei
Currently bio based IO poll needs to poll all hw queue blindly, this way is very inefficient, and the big reason is that we can't pass bio submission result to io poll task. In IO submission context, track associated underlying bios by per-task submission queue and save 'cookie' poll data in

[dm-devel] [RFC PATCH V2 06/13] block: add new field into 'struct bvec_iter'

2021-03-18 Thread Ming Lei
There is a hole at the end of 'struct bvec_iter', so put a new field here and we can save cookie returned from submit_bio() here for supporting bio based polling. This way can avoid to extend bio unnecessarily. Signed-off-by: Ming Lei --- include/linux/bvec.h | 9 + 1 file changed, 9

[dm-devel] [RFC PATCH V2 12/13] dm: support IO polling for bio-based dm device

2021-03-18 Thread Ming Lei
From: Jeffle Xu IO polling is enabled when all underlying target devices are capable of IO polling. The sanity check supports the stacked device model, in which one dm device may be build upon another dm device. In this case, the mapped device will check if the underlying dm target device

[dm-devel] [RFC PATCH V2 00/13] block: support bio based io polling

2021-03-18 Thread Ming Lei
Hi, Add per-task io poll context for holding HIPRI blk-mq/underlying bios queued from bio based driver's io submission context, and reuse one bio padding field for storing 'cookie' returned from submit_bio() for these bios. Also explicitly end these bios in poll context by adding two new bio

[dm-devel] [RFC PATCH V2 13/13] blk-mq: limit hw queues to be polled in each blk_poll()

2021-03-18 Thread Ming Lei
Limit at most 8 queues are polled in each blk_pull(), avoid to add extra latency when queue depth is high. Signed-off-by: Ming Lei --- block/blk-mq.c | 66 +++--- 1 file changed, 46 insertions(+), 20 deletions(-) diff --git a/block/blk-mq.c

[dm-devel] [RFC PATCH V2 11/13] block: add poll_capable method to support bio-based IO polling

2021-03-18 Thread Ming Lei
From: Jeffle Xu This method can be used to check if bio-based device supports IO polling or not. For mq devices, checking for hw queue in polling mode is adequate, while the sanity check shall be implementation specific for bio-based devices. For example, dm device needs to check if all

[dm-devel] [RFC PATCH V2 10/13] block: add queue_to_disk() to get gendisk from request_queue

2021-03-18 Thread Ming Lei
From: Jeffle Xu Sometimes we need to get the corresponding gendisk from request_queue. It is preferred that block drivers store private data in gendisk->private_data rather than request_queue->queuedata, e.g. see: commit c4a59c4e5db3 ("dm: stop using ->queuedata"). So if only request_queue is

[dm-devel] [RFC PATCH V2 08/13] block: prepare for supporting bio_list via other link

2021-03-18 Thread Ming Lei
So far bio list helpers always use .bi_next to traverse the list, we will support to link bios by other bio field. Prepare for such support by adding a macro so that users can define another helpers for linking bios by other bio field. Signed-off-by: Ming Lei --- include/linux/bio.h | 132

[dm-devel] [RFC PATCH V2 04/13] block: create io poll context for submission and poll task

2021-03-18 Thread Ming Lei
Create per-task io poll context for both IO submission and poll task if the queue is bio based and supports polling. This io polling context includes two queues: submission queue(sq) for storing HIPRI bio submission result(cookie) and the bio, written by submission task and read by poll task;

[dm-devel] [RFC PATCH V2 03/13] block: add helper of blk_create_io_context

2021-03-18 Thread Ming Lei
Add one helper for creating io context and prepare for supporting efficient bio based io poll. Meantime move the code of creating io_context before checking bio's REQ_HIPRI flag because the following patch may change to clear REQ_HIPRI if io_context can't be created. Signed-off-by: Ming Lei ---

[dm-devel] [RFC PATCH V2 05/13] block: add req flag of REQ_TAG

2021-03-18 Thread Ming Lei
Add one req flag REQ_TAG which will be used in the following patch for supporting bio based IO polling. Exactly this flag can help us to do: 1) request flag is cloned in bio_fast_clone(), so if we mark one FS bio as REQ_TAG, all bios cloned from this FS bio will be marked as REQ_TAG. 2)create

[dm-devel] [RFC PATCH V2 01/13] block: add helper of blk_queue_poll

2021-03-18 Thread Ming Lei
There has been 3 users, and will be more, so add one such helper. Signed-off-by: Ming Lei --- block/blk-core.c | 2 +- block/blk-mq.c | 3 +-- drivers/nvme/host/core.c | 2 +- include/linux/blkdev.h | 1 + 4 files changed, 4 insertions(+), 4 deletions(-) diff --git

[dm-devel] [RFC PATCH V2 02/13] block: add one helper to free io_context

2021-03-18 Thread Ming Lei
Prepare for putting bio poll queue into io_context, so add one helper for free io_context. Signed-off-by: Ming Lei --- block/blk-ioc.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/block/blk-ioc.c b/block/blk-ioc.c index 57299f860d41..b0cde18c4b8c 100644 ---

Re: [dm-devel] [PATCH v2 3/3] multipath-tools tests: check if /sys/dev/block is non-empty

2021-03-18 Thread Benjamin Marzinski
On Thu, Mar 18, 2021 at 10:14:13AM +0100, mwi...@suse.com wrote: > From: Martin Wilck > > Since f131e31 ("multipath-tools: devt test: avoid failure when run in > containers"), we check the existence of /sys/dev/block before running > the devt test. It turns out that on recent releases of podman

Re: [dm-devel] [RFC PATCH 08/11] block: use per-task poll context to implement bio based io poll

2021-03-18 Thread Mike Snitzer
On Wed, Mar 17 2021 at 3:19am -0400, Ming Lei wrote: > On Wed, Mar 17, 2021 at 11:49:00AM +0800, JeffleXu wrote: > > > > > > On 3/16/21 7:00 PM, JeffleXu wrote: > > > > > > > > > On 3/16/21 3:17 PM, Ming Lei wrote: > > >> On Tue, Mar 16, 2021 at 02:46:08PM +0800, JeffleXu wrote: > > >>> It

Re: [dm-devel] [PATCH v2 1/3] libmultipath: merge update_multipath_table() and update_multipath_status()

2021-03-18 Thread Benjamin Marzinski
On Thu, Mar 18, 2021 at 10:14:11AM +0100, mwi...@suse.com wrote: > From: Martin Wilck > > Since 378cb66 ("multipath: use update_pathvec_from_dm()"), > we remove paths and even pathgroups from multipathd's data structures > in update_multipath_table() if these paths are found to be non-existent.

[dm-devel] [PATCH v2 3/3] multipath-tools tests: check if /sys/dev/block is non-empty

2021-03-18 Thread mwilck
From: Martin Wilck Since f131e31 ("multipath-tools: devt test: avoid failure when run in containers"), we check the existence of /sys/dev/block before running the devt test. It turns out that on recent releases of podman (3.0.1), this check is insufficient, because /sys/dev/block exists now in

[dm-devel] [PATCH v2 2/3] 11-dm-mpath.rules: run "multipath -U" with -v1

2021-03-18 Thread mwilck
From: Martin Wilck In cases where some path devices are temporarily unavailable (e.g. failover), high amounts of error messages such as these are seen: Feb 27 08:02:03 ictm1608s02h1 multipath[1420]: get_udev_device: failed to look up 65:224 with type 1 Feb 27 08:02:03 ictm1608s02h1

[dm-devel] [PATCH v2 1/3] libmultipath: merge update_multipath_table() and update_multipath_status()

2021-03-18 Thread mwilck
From: Martin Wilck Since 378cb66 ("multipath: use update_pathvec_from_dm()"), we remove paths and even pathgroups from multipathd's data structures in update_multipath_table() if these paths are found to be non-existent. But update_multipath_status() is called afterwards, and it uses the

[dm-devel] Thread-safety of libdevmapper

2021-03-18 Thread Demi M. Obenour
>From discussions with the Stratis developers, it appears that libdevmapper is not thread-safe. This is very annoying, since it means that every other library that uses it needs to coordinate synchronization. Is there some fundamental reason that libdevmapper is not thread-safe, such as the use

Re: [dm-devel] [PATCH v3 05/11] mm, fsdax: Refactor memory-failure handler for dax mapping

2021-03-18 Thread ruansy.f...@fujitsu.com
> -Original Message- > From: zhong jiang > Subject: Re: [PATCH v3 05/11] mm, fsdax: Refactor memory-failure handler for > dax mapping > > > +int mf_dax_mapping_kill_procs(struct address_space *mapping, pgoff_t > > +index, int flags) { > > + const bool unmap_success = true; > > +

Re: [dm-devel] [RFC PATCH 08/11] block: use per-task poll context to implement bio based io poll

2021-03-18 Thread JeffleXu
On 3/17/21 10:54 AM, Ming Lei wrote: > On Tue, Mar 16, 2021 at 04:52:36PM +0800, JeffleXu wrote: >> >> >> On 3/16/21 3:17 PM, Ming Lei wrote: >>> On Tue, Mar 16, 2021 at 02:46:08PM +0800, JeffleXu wrote: It is a giant progress to gather all split bios that need to be polled in a

Re: [dm-devel] [RFC PATCH 08/11] block: use per-task poll context to implement bio based io poll

2021-03-18 Thread JeffleXu
On 3/16/21 7:00 PM, JeffleXu wrote: > > > On 3/16/21 3:17 PM, Ming Lei wrote: >> On Tue, Mar 16, 2021 at 02:46:08PM +0800, JeffleXu wrote: >>> It is a giant progress to gather all split bios that need to be polled >>> in a per-task queue. Still some comments below. >>> >>> >>> On 3/16/21

[dm-devel] [PATCH] dm: unexport dm_{get,put}_table_device

2021-03-18 Thread Christoph Hellwig
These are only used inside the main dm module. Signed-off-by: Christoph Hellwig --- drivers/md/dm.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 50b693d776d603..f81bfacfd80de3 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -840,7 +840,6 @@