Re: [dm-devel] can we reduce bio_set_dev overhead due to bio_associate_blkg?

2022-04-11 Thread Mike Snitzer
On Sat, Apr 09 2022 at 1:15P -0400, Christoph Hellwig wrote: > On Fri, Apr 08, 2022 at 11:42:51AM -0400, Mike Snitzer wrote: > > I think we can achieve the goal of efficient cloning/remapping for > > both usecases simply by splitting out the bio_set_dev() and leaving it &g

Re: [dm-devel] can we reduce bio_set_dev overhead due to bio_associate_blkg?

2022-04-08 Thread Mike Snitzer
On Thu, Mar 31 2022 at 5:15P -0400, Christoph Hellwig wrote: > On Wed, Mar 30, 2022 at 10:52:13PM -0700, Dennis Zhou wrote: > > I took a quick look. It seems with the new interface, > > bio_clone_blkg_association() is unnecessary given the correct > > association should be derived from the

Re: [dm-devel] [RFC PATCH] io_uring: reissue in case -EAGAIN is returned after io issue returns

2022-04-06 Thread Mike Snitzer
On Tue, Apr 05 2022 at 10:09P -0400, Ming Lei wrote: > On Mon, Apr 04, 2022 at 12:51:30PM -0400, Mike Snitzer wrote: > > On Sun, Apr 03 2022 at 7:45P -0400, > > Ming Lei wrote: > > > > > -EAGAIN still may return after io issue returns, and REQ_F_REISSUE is >

Re: [dm-devel] [RFC PATCH] md: dm-init: Wait devices if it's not find on first adpet

2022-04-05 Thread Mike Snitzer
On Fri, Apr 01 2022 at 6:07P -0400, Michael Trimarchi wrote: > The device driver can be deferrable and can be a race during > the dm-init early. We need to wait all the probe are really finished > in a loop as is done in do_mounts. This is was tested on kernel 5.4 > but code seems was not

Re: [dm-devel] [RFC PATCH] io_uring: reissue in case -EAGAIN is returned after io issue returns

2022-04-04 Thread Mike Snitzer
> Current dm io polling may return -EAGAIN after bio submission is > returned, also blk-throttle might trigger this situation too. > > Cc: Mike Snitzer > Signed-off-by: Ming Lei I first reverted commit 5291984004ed ("dm: fix bio polling to handle possibile BLK_STS_AGAIN")

[dm-devel] [git pull] device mapper fixes for 5.18-rc1

2022-04-01 Thread Mike Snitzer
Hi Linus, The following changes since commit 3f7282139fe1594be464b90141d56738e7a0ea8a: Merge tag 'for-5.18/64bit-pi-2022-03-25' of git://git.kernel.dk/linux-block (2022-03-26 12:01:35 -0700) are available in the Git repository at:

Re: [dm-devel] md: fix missing check on list iterator

2022-04-01 Thread Mike Snitzer
On Sun, Mar 27 2022 at 1:37P -0400, Xiaomeng Tong wrote: > The bug is here: > bypass_pg(m, pg, bypassed); > > The list iterator 'pg' will point to a bogus position containing > HEAD if the list is empty or no element is found. This case must > be checked before any use of the iterator,

[dm-devel] can we reduce bio_set_dev overhead due to bio_associate_blkg?

2022-03-30 Thread Mike Snitzer
Hey Tejun and Dennis, I recently found that due to bio_set_dev()'s call to bio_associate_blkg(), bio_set_dev() needs much more cpu than ideal; especially when doing 4K IOs via io_uring's HIPRI bio-polling. I'm very naive about blk-cgroups.. so I'm hopeful you or others can help me cut through

[dm-devel] [PATCH v3 1/3] block: allow using the per-cpu bio cache from bio_alloc_bioset

2022-03-25 Thread Mike Snitzer
the functionality tied to struct kiocb. Signed-off-by: Mike Snitzer [hch: refactored a bit] Signed-off-by: Christoph Hellwig --- block/bio.c | 86 ++- block/blk.h | 3 +- block/fops.c | 11 -- include/linux

[dm-devel] [PATCH v3 0/3] block/dm: use BIOSET_PERCPU_CACHE from bio_alloc_bioset

2022-03-25 Thread Mike Snitzer
on block accordingly. Thanks, Mike v3: tweaked some code comments, refined patch headers and folded DM patches so only one DM patch now. v2: add REQ_ALLOC_CACHE and move use of bio_alloc_percpu_cache to bio_alloc_bioset Mike Snitzer (3): block: allow using the per-cpu bio cache from

[dm-devel] [PATCH v3 2/3] block: allow use of per-cpu bio alloc cache by block drivers

2022-03-25 Thread Mike Snitzer
bio_clear_polled() to include/linux/bio.h to allow users outside of block core. Signed-off-by: Mike Snitzer --- block/bio.c | 2 ++ block/blk.h | 6 -- include/linux/bio.h | 6 ++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/block/bio.c b/block/bio.c index

[dm-devel] [PATCH v3 3/3] dm: conditionally enable BIOSET_PERCPU_CACHE for dm_io bioset

2022-03-25 Thread Mike Snitzer
polling (REQ_POLLED) perf by 7 - 20% depending on the system. Signed-off-by: Mike Snitzer --- drivers/md/dm-table.c | 11 --- drivers/md/dm.c | 8 drivers/md/dm.h | 4 ++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/md/dm-table.c b

Re: [dm-devel] [PATCH v2 0/4] block/dm: use BIOSET_PERCPU_CACHE from bio_alloc_bioset

2022-03-24 Thread Mike Snitzer
On Thu, Mar 24 2022 at 3:39P -0400, Christoph Hellwig wrote: > On Wed, Mar 23, 2022 at 03:45:20PM -0400, Mike Snitzer wrote: > > I tried to address your review of the previous set. Patch 1 and 2 can > > obviously be folded but I left them split out for review purposes. >

Re: [dm-devel] [device-mapper-dm:dm-5.19 132/132] drivers/md/dm.c:1542:18: error: 'result' undeclared

2022-03-23 Thread Mike Snitzer
On Wed, Mar 23 2022 at 6:57P -0400, kernel test robot wrote: > tree: > https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git > dm-5.19 > head: 7f8ac95a6464b895e3d2b6175f7ee64a4c10fcfe > commit: 7f8ac95a6464b895e3d2b6175f7ee64a4c10fcfe [132/132] dm: push error >

[dm-devel] [git pull] device mapper changes for 5.18

2022-03-23 Thread Mike Snitzer
ev dm: stop using bdevname Colin Ian King (1): dm cache policy smq: make static read-only array table const Jordy Zomer (1): dm ioctl: prevent potential spectre v1 gadget Kirill Tkhai (1): dm: fix use-after-free in dm_cleanup_zoned_dev() Mike Snitzer (33): dm:

[dm-devel] [PATCH v2 3/4] dm: enable BIOSET_PERCPU_CACHE for dm_io bioset

2022-03-23 Thread Mike Snitzer
Also change dm_io_complete() to use bio_clear_polled() so that it properly clears all associated bio state (REQ_POLLED, BIO_PERCPU_CACHE, etc). This commit improves DM's hipri bio polling (REQ_POLLED) perf by ~7%. Signed-off-by: Mike Snitzer --- drivers/md/dm.c | 6 +++--- 1 file changed, 3

[dm-devel] [PATCH v2 2/4] block: allow BIOSET_PERCPU_CACHE use from bio_alloc_bioset

2022-03-23 Thread Mike Snitzer
participation in a specific alloc cache (BIO_PERCPU_CACHE). Otherwise an upper layer's bioset may not have an alloc cache, in which case the bio issued to underlying device(s) wouldn't reflect that allocating from an alloc cache warranted (if possible). Signed-off-by: Mike Snitzer --- block/bio.c

[dm-devel] [PATCH v2 4/4] dm: conditionally enable BIOSET_PERCPU_CACHE for bio-based dm_io bioset

2022-03-23 Thread Mike Snitzer
A bioset's percpu cache may have broader utility in the future but for now constrain it to being tightly coupled to QUEUE_FLAG_POLL. Signed-off-by: Mike Snitzer --- drivers/md/dm-table.c | 11 --- drivers/md/dm.c | 6 +++--- drivers/md/dm.h | 4 ++-- 3 files changed, 13

[dm-devel] [PATCH v2 1/4] block: allow BIOSET_PERCPU_CACHE use from bio_alloc_clone

2022-03-23 Thread Mike Snitzer
ove bio_clear_polled() to include/linux/bio.h to allow users outside of block core. Signed-off-by: Mike Snitzer --- block/bio.c | 56 + block/blk.h | 7 --- include/linux/bio.h | 7 +++ 3 files changed, 42 insertions(+), 28 deleti

[dm-devel] [PATCH v2 0/4] block/dm: use BIOSET_PERCPU_CACHE from bio_alloc_bioset

2022-03-23 Thread Mike Snitzer
to bio_alloc_bioset Mike Snitzer (4): block: allow BIOSET_PERCPU_CACHE use from bio_alloc_clone block: allow BIOSET_PERCPU_CACHE use from bio_alloc_bioset dm: enable BIOSET_PERCPU_CACHE for dm_io bioset dm: conditionally enable BIOSET_PERCPU_CACHE for bio-based dm_io bioset block/bio.c

Re: [dm-devel] [PATCH 1/3] block: allow BIOSET_PERCPU_CACHE use from bio_alloc_clone

2022-03-22 Thread Mike Snitzer
On Tue, Mar 22 2022 at 3:54P -0400, Christoph Hellwig wrote: > On Tue, Mar 22, 2022 at 03:49:25PM -0400, Mike Snitzer wrote: > > - bio = bio_alloc_bioset(bdev, 0, bio_src->bi_opf, gfp, bs); > > + if (bs->cache && bio_src->bi_opf & REQ_POLLED) > >

[dm-devel] [PATCH 2/3] dm: enable BIOSET_PERCPU_CACHE for dm_io bioset

2022-03-22 Thread Mike Snitzer
in process context. This change improves DM's hipri bio polling performance by ~7%. Signed-off-by: Mike Snitzer --- drivers/md/dm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index a2e80c376827..06f3720a190b 100644 --- a/drivers

[dm-devel] [PATCH 0/3] block/dm: use BIOSET_PERCPU_CACHE from bio_alloc_clone

2022-03-22 Thread Mike Snitzer
, this series builds on linux-dm.git's "dm-5.18" branch, and the commits in this series are available in linux-dm.git's "dm-5.19" branch). Thanks, Mike Mike Snitzer (3): block: allow BIOSET_PERCPU_CACHE use from bio_alloc_clone dm: enable BIOSET_PERCPU_CACHE for dm_io bioset dm:

[dm-devel] [PATCH 3/3] dm: conditionally enable BIOSET_PERCPU_CACHE for bio-based dm_io bioset

2022-03-22 Thread Mike Snitzer
There is no point establishing the bioset percpu cache if request_queue won't have QUEUE_FLAG_POLL. Signed-off-by: Mike Snitzer --- drivers/md/dm-table.c | 11 --- drivers/md/dm.c | 6 +++--- drivers/md/dm.h | 4 ++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff

[dm-devel] [PATCH 1/3] block: allow BIOSET_PERCPU_CACHE use from bio_alloc_clone

2022-03-22 Thread Mike Snitzer
nux/bio.h to allow users outside of block core. Signed-off-by: Mike Snitzer --- block/bio.c | 56 + block/blk.h | 7 --- include/linux/bio.h | 7 +++ 3 files changed, 42 insertions(+), 28 deletions(-) diff --git a/bl

[dm-devel] [PATCH v6 2/2] dm: support bio polling

2022-03-07 Thread Mike Snitzer
which is retrieved via bio->bi_bio_drv_data; call dm_io_dec_pending() after the target io is done in .poll_bio() 5) enable QUEUE_FLAG_POLL if all underlying queues enable QUEUE_FLAG_POLL, which is based on Jeffle's previous patch. Signed-off-by: Ming Lei Signed-off-by: Mike Snitzer --- driv

[dm-devel] [PATCH v6 0/2] block/dm: support bio polling

2022-03-07 Thread Mike Snitzer
Hi, I've rebased Ming's latest [1] ontop of dm-5.18 [2] (which is based on for-5.18/block). End result available in dm-5.18-biopoll branch [3] These changes add bio polling support to DM. Tested with linear and striped DM targets. IOPS improvement was ~5% on my baremetal system with a single

[dm-devel] [PATCH v6 1/2] block: add ->poll_bio to block_device_operations

2022-03-07 Thread Mike Snitzer
: Ming Lei Signed-off-by: Mike Snitzer --- block/blk-core.c | 14 +- block/genhd.c | 4 include/linux/blkdev.h | 2 ++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 94bf37f8e61d..ce08f0aa9dfc 100644 --- a

Re: [dm-devel] remove bio_devname

2022-03-07 Thread Mike Snitzer
On Mon, Mar 07 2022 at 11:48P -0500, Christoph Hellwig wrote: > On Mon, Mar 07, 2022 at 11:45:53AM -0500, Mike Snitzer wrote: > > Should those go through block too? Or is there no plan to remove > > bdevname()? > > My preference would be: do the full bio_devname removal

Re: [dm-devel] remove bio_devname

2022-03-07 Thread Mike Snitzer
On Mon, Mar 07 2022 at 8:42P -0500, Jens Axboe wrote: > On Fri, 4 Mar 2022 19:00:55 +0100, Christoph Hellwig wrote: > > this series removes the bio_devname helper and just switches all users > > to use the %pg format string directly. > > > > Diffstat > > block/bio.c |6

Re: [dm-devel] [PATCH v4 0/2] block/dm: support bio polling

2022-03-04 Thread Mike Snitzer
On Fri, Mar 04 2022 at 8:43P -0500, Ming Lei wrote: > On Fri, Mar 04, 2022 at 04:26:21PM -0500, Mike Snitzer wrote: > > Hi, > > > > I've rebased Ming's latest [1] ontop of dm-5.18 [2] (which is based on > > for-5.18/block). End result available i

[dm-devel] [PATCH v5 0/2] block/dm: support bio polling

2022-03-04 Thread Mike Snitzer
Hi, I've rebased Ming's latest [1] ontop of dm-5.18 [2] (which is based on for-5.18/block). End result available in dm-5.18-biopoll branch [3] These changes add bio polling support to DM. Tested with linear and striped DM targets. IOPS improvement was ~5% on my baremetal system with a single

[dm-devel] [PATCH v5 2/2] dm: support bio polling

2022-03-04 Thread Mike Snitzer
which is retrieved via bio->bi_bio_drv_data; call dm_io_dec_pending() after the target io is done in .poll_bio() 5) enable QUEUE_FLAG_POLL if all underlying queues enable QUEUE_FLAG_POLL, which is based on Jeffle's previous patch. Signed-off-by: Ming Lei Signed-off-by: Mike Snitzer --- drivers/md/

[dm-devel] [PATCH v5 1/2] block: add ->poll_bio to block_device_operations

2022-03-04 Thread Mike Snitzer
From: Ming Lei Prepare for supporting IO polling for bio-based driver. Add ->poll_bio callback so that bio-based driver can provide their own logic for polling bio. Also fix ->submit_bio_bio typo in comment block above __submit_bio_noacct. Signed-off-by: Ming Lei Signed-off-by: Mike S

Re: [dm-devel] [PATCH v4 1/2] block: add ->poll_bio to block_device_operations

2022-03-04 Thread Mike Snitzer
On Fri, Mar 04 2022 at 4:39P -0500, Jens Axboe wrote: > On 3/4/22 2:26 PM, Mike Snitzer wrote: > > diff --git a/block/blk-core.c b/block/blk-core.c > > index 94bf37f8e61d..e739c6264331 100644 > > --- a/block/blk-core.c > > +++ b/block/blk-core.c > > @@ -985,10 +

[dm-devel] [PATCH v4 1/2] block: add ->poll_bio to block_device_operations

2022-03-04 Thread Mike Snitzer
From: Ming Lei Prepare for supporting IO polling for bio based driver. Add ->poll_bio callback so that bio driver can provide their own logic for polling bio. Signed-off-by: Ming Lei Signed-off-by: Mike Snitzer --- block/blk-core.c | 12 +--- block/genhd.c |

[dm-devel] [PATCH v4 0/2] block/dm: support bio polling

2022-03-04 Thread Mike Snitzer
Hi, I've rebased Ming's latest [1] ontop of dm-5.18 [2] (which is based on for-5.18/block). End result available in dm-5.18-biopoll branch [3] These changes add bio polling support to DM. Tested with linear and striped DM targets. IOPS improvement was ~5% on my baremetal system with a single

[dm-devel] [PATCH v4 2/2] dm: support bio polling

2022-03-04 Thread Mike Snitzer
which is retrieved via bio->bi_bio_drv_data; call dm_io_dec_pending() after the target io is done in .poll_bio() 5) enable QUEUE_FLAG_POLL if all underlying queues enable QUEUE_FLAG_POLL, which is based on Jeffle's previous patch. Signed-off-by: Ming Lei Signed-off-by: Mike Snitzer --- drivers/md/

Re: [dm-devel] [PATCH V3 0/3] block/dm: support bio polling

2022-03-01 Thread Mike Snitzer
On Mon, Feb 28 2022 at 7:58P -0500, Ming Lei wrote: > On Mon, Feb 28, 2022 at 11:27:44AM -0500, Mike Snitzer wrote: > > > > Hey Ming, > > > > I'd like us to follow-through with adding bio-based polling support. > > Kind of strange none of us that were sent

Re: [dm-devel] [PATCH V3 0/3] block/dm: support bio polling

2022-02-28 Thread Mike Snitzer
On Wed, Jun 23 2021 at 3:40P -0400, Ming Lei wrote: > Hello Guys, > > Based on Christoph's bio based polling model[1], implement DM bio polling > with one very simple approach. > > Patch 1 adds helper of blk_queue_poll(). > > Patch 2 adds .bio_poll() callback to block_device_operations, so

Re: [dm-devel] Revert "dm space maps: don't reset space map allocation cursor when committing"

2022-02-28 Thread Mike Snitzer
s discards. The thin-pool controls the allocation of underlying storage. So all said: Nacked-by: Mike Snitzer -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH RESEND v2] dm: Fix use-after-free in dm_cleanup_zoned_dev()

2022-02-22 Thread Mike Snitzer
On Thu, Feb 17, 2022 at 5:49 AM Damien Le Moal wrote: > > On 2/17/22 19:13, Kirill Tkhai wrote: > > > > dm_cleanup_zoned_dev() uses queue, so it must be called > > before blk_cleanup_disk() starts its killing: > > > > blk_cleanup_disk->blk_cleanup_queue()->kobject_put()->blk_release_queue()-> > >

Re: [dm-devel] dm: introduce a DM_ENFORCE_OPEN_COUNT flag.

2022-02-22 Thread Mike Snitzer
On Wed, Feb 02 2022 at 9:42P -0500, Christoph Hellwig wrote: > Withmy block hat on: nak to this. No block driver has any business at > all rejecting "too many openers". In fact any opener but the first of > a partition is already not counted as an opener, and I plan to complete > hide the

Re: [dm-devel] dm: make sure dm_table is binded before queue request

2022-02-22 Thread Mike Snitzer
On Wed, Feb 09 2022 at 4:37P -0500, Zhang Yi wrote: > We found a NULL pointer dereference problem when using dm-mpath target. > The problem is if we submit IO between loading and binding the table, > we could neither get a valid dm_target nor a valid dm table when > submitting request in

Re: [dm-devel] [PATCH v3 08/10] dm: Add support for copy offload.

2022-02-22 Thread Mike Snitzer
On Mon, Feb 14 2022 at 2:59P -0500, Nitesh Shetty wrote: > Before enabling copy for dm target, check if underlying devices and > dm target support copy. Avoid split happening inside dm target. > Fail early if the request needs split, currently splitting copy > request is not supported. > >

Re: [dm-devel] a potential issue for bow_target after "dm: delay registering the gendisk" applied

2022-02-21 Thread Mike Snitzer
On Mon, Feb 21 2022 at 5:36P -0500, Faqiang Zhu wrote: > Hi Christoph, > > > > Recently when I use kernel5.15 with android, an issue related to bow_target > is found with below log: > > > > [8.935429][T1] kobject_add_internal failed for bow (error: -2 > parent: (null)) > > >

Re: [dm-devel] [PATCH 6/7] dm: remove write same support

2022-02-16 Thread Mike Snitzer
On Wed, Feb 09 2022 at 3:28P -0500, Christoph Hellwig wrote: > There are no more end-users of REQ_OP_WRITE_SAME left, so we can start > deleting it. > > Signed-off-by: Christoph Hellwig Thanks. Reviewed-by: Mike Snitzer -- dm-devel mailing list dm-devel@redh

Re: [dm-devel] make the blk-mq stacking interface optional

2022-02-16 Thread Mike Snitzer
he ufs > driver more easily. And while I touched this code I also ended up > cleaning up various loose ends. All look good to me, thanks, for series: Reviewed-by: Mike Snitzer -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH v2 10/14] block: add bio_start_io_acct_remapped for the benefit of DM

2022-02-14 Thread Mike Snitzer
On Mon, Feb 14 2022 at 9:02P -0500, Christoph Hellwig wrote: > On Fri, Feb 11, 2022 at 04:40:53PM -0500, Mike Snitzer wrote: > > DM needs the ability to account a clone bio's IO to the original > > block_device. So add @orig_bdev argument to bio_start_io_acct_time.

[dm-devel] [PATCH v2 02/14] dm: fold __clone_and_map_data_bio into __split_and_process_bio

2022-02-11 Thread Mike Snitzer
Fold __clone_and_map_data_bio into its only caller. Reviewed-by: Christoph Hellwig Signed-off-by: Mike Snitzer --- drivers/md/dm.c | 30 -- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 2cecb8832936

[dm-devel] [PATCH v2 01/14] dm: rename split functions

2022-02-11 Thread Mike Snitzer
Rename __split_and_process_bio to dm_split_and_process_bio. Rename __split_and_process_non_flush to __split_and_process_bio. Also fix a stale comment and whitespace. Reviewed-by: Christoph Hellwig Signed-off-by: Mike Snitzer --- drivers/md/dm.c | 22 +++--- 1 file changed, 11

[dm-devel] [PATCH v2 13/14] dm delay: use dm_submit_bio_remap

2022-02-11 Thread Mike Snitzer
Signed-off-by: Mike Snitzer --- drivers/md/dm-delay.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm-delay.c b/drivers/md/dm-delay.c index 59e51d285b0e..9a51bf51a859 100644 --- a/drivers/md/dm-delay.c +++ b/drivers/md/dm-delay.c @@ -72,7 +72,7 @@ static

[dm-devel] [PATCH v2 14/14] dm: move duplicate code in callers of alloc_tio into alloc_tio

2022-02-11 Thread Mike Snitzer
Suggested-by: Christoph Hellwig Signed-off-by: Mike Snitzer --- drivers/md/dm.c | 27 +-- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 2461df65e2fe..20c7b1b4d1f7 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c

[dm-devel] [PATCH v2 11/14] dm: add dm_submit_bio_remap interface

2022-02-11 Thread Mike Snitzer
nly started once. Suggested-by: Mikulas Patocka Signed-off-by: Mike Snitzer --- drivers/md/dm-core.h | 1 + drivers/md/dm.c | 59 --- include/linux/device-mapper.h | 7 + include/uapi/linux/dm-ioctl.h | 4 +-- 4 files changed,

[dm-devel] [PATCH v2 07/14] dm: remove code only needed before submit_bio recursion

2022-02-11 Thread Mike Snitzer
sector cursor, in __send_duplicate_bios(). Reviewed-by: Christoph Hellwig Signed-off-by: Mike Snitzer --- drivers/md/dm.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 137e578785f6..164cccf59297 100644 --- a/drivers/md/dm.c +++ b/dr

[dm-devel] [PATCH v2 06/14] dm: remove unused mapped_device argument from free_tio

2022-02-11 Thread Mike Snitzer
Reviewed-by: Christoph Hellwig Signed-off-by: Mike Snitzer --- drivers/md/dm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index bd07ccadbf01..137e578785f6 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -539,7 +539,7 @@ static

[dm-devel] [PATCH v2 04/14] dm: reduce code duplication in __map_bio

2022-02-11 Thread Mike Snitzer
Error path code (for handling DM_MAPIO_REQUEUE and DM_MAPIO_KILL) is effectively identical. Reviewed-by: Christoph Hellwig Signed-off-by: Mike Snitzer --- drivers/md/dm.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c

[dm-devel] [PATCH v2 00/14] dm: improve bio-based IO accounting

2022-02-11 Thread Mike Snitzer
/archives/dm-devel/2022-February/msg00193.html Christoph, I addressed all your feedback from v1 and added the Reviewed-by:s you provided. Thanks for your review. Patch 10 now isolates the block changes like you asked. All further review of this v2 patchset is welcomed. Mike Mike Snitzer (14

[dm-devel] [PATCH v2 12/14] dm crypt: use dm_submit_bio_remap

2022-02-11 Thread Mike Snitzer
Signed-off-by: Mike Snitzer --- drivers/md/dm-crypt.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index a5006cb6ee8a..337517cb4e90 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -1855,7 +1855,7

[dm-devel] [PATCH v2 09/14] dm: move kicking of suspend queue to dm_io_dec_pending

2022-02-11 Thread Mike Snitzer
Move kicking of the suspend queue to dm_io_dec_pending (the only caller) since end_io_acct will soon only be called if IO accounting was started. Also, some comment tweaks and removal of local variables. No functional change. Reviewed-by: Christoph Hellwig Signed-off-by: Mike Snitzer

[dm-devel] [PATCH v2 05/14] dm: remove impossible BUG_ON in __send_empty_flush

2022-02-11 Thread Mike Snitzer
The flush_bio in question was just initialized to be empty, so there is no way bio_has_data() will return true. So remove stale BUG_ON(). Reviewed-by: Christoph Hellwig Signed-off-by: Mike Snitzer --- drivers/md/dm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/md/dm.c b/drivers

[dm-devel] [PATCH v2 10/14] block: add bio_start_io_acct_remapped for the benefit of DM

2022-02-11 Thread Mike Snitzer
to blkdev.h and have it call bio_start_io_acct_remapped. Signed-off-by: Mike Snitzer --- block/blk-core.c | 24 drivers/md/dm.c| 3 ++- include/linux/blkdev.h | 16 ++-- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/block/blk-core.c b

[dm-devel] [PATCH v2 08/14] dm: record old_sector in dm_target_io before calling map function

2022-02-11 Thread Mike Snitzer
Prep for being able to defer trace_block_bio_remap() until when the bio is remapped and submitted by the DM target. Reviewed-by: Christoph Hellwig Signed-off-by: Mike Snitzer --- drivers/md/dm-core.h | 1 + drivers/md/dm.c | 7 --- 2 files changed, 5 insertions(+), 3 deletions

[dm-devel] [PATCH v2 03/14] dm: refactor dm_split_and_process_bio a bit

2022-02-11 Thread Mike Snitzer
Remove needless branching and indentation. Leaves code to catch malformed op_is_zone_mgmt bios (they shouldn't have a payload). Reviewed-by: Christoph Hellwig Signed-off-by: Mike Snitzer --- drivers/md/dm.c | 54 -- 1 file changed, 28

Re: [dm-devel] dm: fix dm_stats accounting

2022-02-11 Thread Mike Snitzer
On Fri, Feb 11 2022 at 10:01P -0500, Mikulas Patocka wrote: > Exactly the same sector number and length must be passed to both calls of > dm_stats_account_io, otherwise its per-zone in_flight counters go out of > sync. This patch fixes it. > > Signed-off-by: Mikulas Patocka > > --- >

Re: [dm-devel] dm: account statistics correctly in case of bio split

2022-02-11 Thread Mike Snitzer
On Fri, Feb 11 2022 at 10:03P -0500, Mikulas Patocka wrote: > If a bio was split to multiple targets, only one target's sub-range was > counted. This patch changes it so that all the targets' ranges are > counted. > > Note that calls to bio_start_io_acct_remapped and bio_end_io_acct must >

[dm-devel] [PATCH 03/14] dm: refactor dm_split_and_process_bio a bit

2022-02-10 Thread Mike Snitzer
Remove needless branching. Leaves code to catch malformed op_is_zone_mgmt bios (they shouldn't have a payload). Signed-off-by: Mike Snitzer --- drivers/md/dm.c | 51 ++- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/drivers/md

[dm-devel] [PATCH 07/14] dm: remove code only needed before submit_bio recursion

2022-02-10 Thread Mike Snitzer
sector cursor, in __send_duplicate_bios(). Signed-off-by: Mike Snitzer --- drivers/md/dm.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index f091bbf8a8dc..5950d518e544 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1176,12 +1176,6 @

[dm-devel] [PATCH 02/14] dm: fold __clone_and_map_data_bio into __split_and_process_bio

2022-02-10 Thread Mike Snitzer
Fold __clone_and_map_data_bio into its only caller. Signed-off-by: Mike Snitzer --- drivers/md/dm.c | 30 -- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 2cecb8832936..2f1942b61d48 100644 --- a/drivers/md/dm.c

[dm-devel] [PATCH 12/14] dm delay: dm_submit_bio_remap

2022-02-10 Thread Mike Snitzer
Signed-off-by: Mike Snitzer --- drivers/md/dm-delay.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm-delay.c b/drivers/md/dm-delay.c index 59e51d285b0e..8235927a3912 100644 --- a/drivers/md/dm-delay.c +++ b/drivers/md/dm-delay.c @@ -72,7 +72,7 @@ static void

[dm-devel] [PATCH 01/14] dm: rename split functions

2022-02-10 Thread Mike Snitzer
Rename __split_and_process_bio to dm_split_and_process_bio. Rename __split_and_process_non_flush to __split_and_process_bio. Also fix a stale comment and whitespace. Signed-off-by: Mike Snitzer --- drivers/md/dm.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions

[dm-devel] [PATCH 08/14] dm: record old_sector in dm_target_io before calling map function

2022-02-10 Thread Mike Snitzer
Prep for being able to defer trace_block_bio_remap() until when the bio is remapped and submitted by the DM target. Signed-off-by: Mike Snitzer --- drivers/md/dm-core.h | 1 + drivers/md/dm.c | 7 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/md/dm-core.h b

[dm-devel] [PATCH 13/14] dm: improve correctness and efficiency of bio-based IO accounting

2022-02-10 Thread Mike Snitzer
Don't use jiffies as a glorified bool because jiffies can/will rollover to 0. Also use xchg(), instead of spin_lock_irq{save,restore} and smp_load_acquire/smp_store_release, to avoid performance impact of disabling and enabling interrupts. Suggested-by: Mikulas Patocka Signed-off-by: Mike

[dm-devel] [PATCH 11/14] dm crypt: use dm_submit_bio_remap

2022-02-10 Thread Mike Snitzer
Signed-off-by: Mike Snitzer --- drivers/md/dm-crypt.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index a5006cb6ee8a..9ea197de08c2 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -1855,7 +1855,7

[dm-devel] [PATCH 10/14] dm: add dm_submit_bio_remap interface

2022-02-10 Thread Mike Snitzer
additional processing of each bio in conjunction with their DM_MAPIO_SUBMITTED return from their map function. Signed-off-by: Mike Snitzer --- drivers/md/dm-core.h | 1 + drivers/md/dm.c | 93 +++ include/linux/device-mapper.h | 7

[dm-devel] [PATCH 06/14] dm: remove unused mapped_device argument from free_tio

2022-02-10 Thread Mike Snitzer
Signed-off-by: Mike Snitzer --- drivers/md/dm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 1985fc3f2a95..f091bbf8a8dc 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -539,7 +539,7 @@ static struct dm_io *alloc_io(struct

[dm-devel] [PATCH 14/14] block: add bio_start_io_acct_remapped for the benefit of DM

2022-02-10 Thread Mike Snitzer
to blkdev.h and have it call bio_start_io_acct_remapped. Improve DM to no longer need to play games with swizzling a clone bio's bi_bdev (in dm_submit_bio_remap) and remove DM's clone_and_start_io_acct() interface. Signed-off-by: Mike Snitzer --- block/blk-core.c | 24

[dm-devel] [PATCH 05/14] dm: remove impossible BUG_ON in __send_empty_flush

2022-02-10 Thread Mike Snitzer
The flush_bio in question was just initialized to be empty, so there is no way bio_has_data() will retrun true. So remove stale BUG_ON(). Signed-off-by: Mike Snitzer --- drivers/md/dm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index cc014e56252e

[dm-devel] [PATCH 09/14] dm: prep for following changes

2022-02-10 Thread Mike Snitzer
. Some comment tweaks and removal of local variables. No functional change. Signed-off-by: Mike Snitzer --- drivers/md/dm-core.h | 2 +- drivers/md/dm.c | 32 ++-- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/drivers/md/dm-core.h b/drivers/md/dm

[dm-devel] [PATCH 04/14] dm: reduce code duplication in __map_bio

2022-02-10 Thread Mike Snitzer
Error path code (for handling DM_MAPIO_REQUEUE and DM_MAPIO_KILL) is effectively identical. Signed-off-by: Mike Snitzer --- drivers/md/dm.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 56734aae718d..cc014e56252e

[dm-devel] [PATCH 00/14] dm: improve bio-based IO accounting

2022-02-10 Thread Mike Snitzer
little indication that anything is happening. Given dm-crypt's cpu intensive nature it takes time to complete IO but unless you look at the underlying devices' iostats you wouldn't see it occurring. Mike Mike Snitzer (14): dm: rename split functions dm: fold __clone_and_map_data_bio

Re: [dm-devel] improve the bio cloning interface v2

2022-02-02 Thread Mike Snitzer
id10.c | 16 +-- > drivers/md/raid5.c |4 > fs/btrfs/extent_io.c |4 > include/linux/bio.h |6 - > 22 files changed, 183 insertions(+), 239 deletions(-) > Looks good, for all: Reviewed-by: Mike Snitzer I

Re: [dm-devel] [PATCH 07/13] dm: retun the clone bio from alloc_tio

2022-02-02 Thread Mike Snitzer
On Wed, Feb 02 2022 at 11:01P -0500, Christoph Hellwig wrote: > Return the clone bio embedded into the tio as that is what the callers > actually want. Similar for the free side. > > Signed-off-by: Christoph Hellwig Small nit, subject has typo: s/retun/return/ -- dm-devel mailing list

[dm-devel] [PATCH v4 0/3] block/dm: fix bio-based DM IO accounting

2022-01-28 Thread Mike Snitzer
se, thanks. Mike v4: added Christoph's Reviewed-bys. Removed READ_ONCE from patch 3 v3: fix patch 3 to call bio_start_io_acct_time v2: made block changes suggested by Christoph Mike Snitzer (3): block: add bio_start_io_acct_time() to control start_time dm: revert partial fix for redundant bio-base

[dm-devel] [PATCH v4 2/3] dm: revert partial fix for redundant bio-based IO accounting

2022-01-28 Thread Mike Snitzer
Reverts a1e1cb72d9649 ("dm: fix redundant IO accounting for bios that need splitting") because it was too narrow in scope (only addressed redundant 'sectors[]' accounting and not ios, nsecs[], etc). Cc: sta...@vger.kernel.org Signed-off-by: Mike Snitzer --- drivers/md

[dm-devel] [PATCH v4 3/3] dm: properly fix redundant bio-based IO accounting

2022-01-28 Thread Mike Snitzer
-by: Bud Brown Reviewed-by: Christoph Hellwig Cc: sta...@vger.kernel.org Depends-on: 1073e8492f88 ("block: add bio_start_io_acct_time() to control start_time") Signed-off-by: Mike Snitzer --- drivers/md/dm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers

[dm-devel] [PATCH v4 1/3] block: add bio_start_io_acct_time() to control start_time

2022-01-28 Thread Mike Snitzer
bio_start_io_acct_time() interface is like bio_start_io_acct() that allows start_time to be passed in. This gives drivers the ability to defer starting accounting until after IO is issued (but possibily not entirely due to bio splitting). Reviewed-by: Christoph Hellwig Signed-off-by: Mike

Re: [dm-devel] [PATCH v3 1/3] block: add bio_start_io_acct_time() to control start_time

2022-01-28 Thread Mike Snitzer
On Fri, Jan 28 2022 at 1:13P -0500, Christoph Hellwig wrote: > On Thu, Jan 27, 2022 at 11:17:51PM -0500, Mike Snitzer wrote: > > + __part_start_io_acct(bio->bi_bdev, bio_sectors(bio), > > +bio_op(bio), start_time); > > } > > +EXPORT_SYM

[dm-devel] [PATCH v3 3/3] dm: properly fix redundant bio-based IO accounting

2022-01-27 Thread Mike Snitzer
-by: Bud Brown Cc: sta...@vger.kernel.org Depends-on: f9893e1da2e3 ("block: add bio_start_io_acct_time() to control start_time") Signed-off-by: Mike Snitzer --- drivers/md/dm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 98

[dm-devel] [PATCH v3 2/3] dm: revert partial fix for redundant bio-based IO accounting

2022-01-27 Thread Mike Snitzer
Reverts a1e1cb72d9649 ("dm: fix redundant IO accounting for bios that need splitting") because it was too narrow in scope (only addressed redundant 'sectors[]' accounting and not ios, nsecs[], etc). Cc: sta...@vger.kernel.org Signed-off-by: Mike Snitzer --- drivers/md

[dm-devel] [PATCH v3 1/3] block: add bio_start_io_acct_time() to control start_time

2022-01-27 Thread Mike Snitzer
bio_start_io_acct_time() interface is like bio_start_io_acct() that allows start_time to be passed in. This gives drivers the ability to defer starting accounting until after IO is issued (but possibily not entirely due to bio splitting). Signed-off-by: Mike Snitzer --- block/blk-core.c

[dm-devel] [PATCH v3 0/3] block/dm: fix bio-based DM IO accounting

2022-01-27 Thread Mike Snitzer
e v2: made block changes suggested by Christoph Mike Snitzer (3): block: add bio_start_io_acct_time() to control start_time dm: revert partial fix for redundant bio-based IO accounting dm: properly fix redundant bio-based IO accounting block/blk-core.c | 25 +++--

Re: [dm-devel] [PATCH v2 3/3] dm: properly fix redundant bio-based IO accounting

2022-01-27 Thread Mike Snitzer
On Thu, Jan 27 2022 at 5:56P -0500, Mike Snitzer wrote: > Record the start_time for a bio but defer the starting block core's IO > accounting until after IO is submitted using bio_start_io_acct_time(). > > This approach avoids the need to mess around with any of the > indi

[dm-devel] [PATCH v2 2/3] dm: revert partial fix for redundant bio-based IO accounting

2022-01-27 Thread Mike Snitzer
Reverts a1e1cb72d9649 ("dm: fix redundant IO accounting for bios that need splitting") because it was too narrow in scope (only addressed redundant 'sectors[]' accounting and not ios, nsecs[], etc). Cc: sta...@vger.kernel.org Signed-off-by: Mike Snitzer --- drivers/md

[dm-devel] [PATCH v2 3/3] dm: properly fix redundant bio-based IO accounting

2022-01-27 Thread Mike Snitzer
-by: Bud Brown Cc: sta...@vger.kernel.org Depends-on: f9893e1da2e3 ("block: add bio_start_io_acct_time() to control start_time") Signed-off-by: Mike Snitzer --- drivers/md/dm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 98

[dm-devel] [PATCH v2 1/3] block: add bio_start_io_acct_time() to control start_time

2022-01-27 Thread Mike Snitzer
bio_start_io_acct_time() interface is like bio_start_io_acct() that allows start_time to be passed in. This gives drivers the ability to defer starting accounting until after IO is issued (but possibily not entirely due to bio splitting). Signed-off-by: Mike Snitzer --- block/blk-core.c

[dm-devel] [PATCH v2 0/3] block/dm: fix bio-based DM IO accounting

2022-01-27 Thread Mike Snitzer
ges suggested by Christoph Mike Snitzer (3): block: add bio_start_io_acct_time() to control start_time dm: revert partial fix for redundant bio-based IO accounting dm: properly fix redundant bio-based IO accounting block/blk-core.c | 25 +++-- drivers/md/dm.

[dm-devel] [PATCH 2/3] dm: revert partial fix for redundant bio-based IO accounting

2022-01-27 Thread Mike Snitzer
Reverts a1e1cb72d9649 ("dm: fix redundant IO accounting for bios that need splitting") because it was too narrow in scope (only addressed redundant 'sectors[]' accounting and not ios, nsecs[], etc). Cc: sta...@vger.kernel.org Signed-off-by: Mike Snitzer --- drivers/md

[dm-devel] [PATCH 3/3] dm: properly fix redundant bio-based IO accounting

2022-01-27 Thread Mike Snitzer
Brown Cc: sta...@vger.kernel.org Depends-on: e8d7405fccc6 ("block: add __bio_start_io_acct() to control start_time") Signed-off-by: Mike Snitzer --- drivers/md/dm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 98

[dm-devel] [PATCH 0/3] block/dm: fix bio-based DM IO accounting

2022-01-27 Thread Mike Snitzer
to pickup this set to send along (I'd obviously still do any stable@ backports). NOTE: the 3rd patch references the linux-dm.git commit id for the 1st patch.. so that'll require tweaking no matter who sends the changes to Linus. Please advise, thanks. Mike Mike Snitzer (3): block: add __bio_sta

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