All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Cc: dm-devel@redhat.com, Damien Le Moal <damien.lemoal@wdc.com>,
	Mike Snitzer <snitzer@redhat.com>
Subject: Re: [dm-devel] [PATCH 1/3] dm: don't grab target io reference in dm_zone_map_bio
Date: Mon, 11 Apr 2022 08:36:20 +0800	[thread overview]
Message-ID: <YlN4BC2qbGODxbVz@T590> (raw)
In-Reply-To: <8b9078c2-7884-a5b5-5aa9-ad284b4068ef@opensource.wdc.com>

On Mon, Apr 11, 2022 at 09:18:56AM +0900, Damien Le Moal wrote:
> On 4/9/22 02:12, Ming Lei wrote:
> > dm_zone_map_bio() is only called from __map_bio in which the io's
> > reference is grabbed already, and the reference won't be released
> > until the bio is submitted, so no necessary to do it dm_zone_map_bio
> > any more.
> 
> I do not think that this patch is correct. Removing the extra reference on
> the io can lead to problems if the io is completed in the target
> ->map(ti, clone) call or before dm_zone_map_bio_end() is called for the
> DM_MAPIO_SUBMITTED or DM_MAPIO_REMAPPED cases. dm_zone_map_bio_end() needs

__map_bio():
	...
	dm_io_inc_pending(io);
	...
	dm_zone_map_bio(tio);
	...

dm_submit_bio():
	dm_split_and_process_bio
		init_clone_info(&ci, md, map, bio)
			atomic_set(&io->io_count, 1)
		...
		__map_bio()
		...
		dm_io_dec_pending()

The target io can only be completed after the above line returns,
so the extra reference in dm_zone_map_bio() doesn't make any difference,
does it?


Thanks, 
Ming
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


  reply	other threads:[~2022-04-11  0:36 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-08 17:12 [dm-devel] [PATCH 0/3] dm: improvement on io referencing and io poll Ming Lei
2022-04-08 17:12 ` [dm-devel] [PATCH 1/3] dm: don't grab target io reference in dm_zone_map_bio Ming Lei
2022-04-11  0:18   ` Damien Le Moal
2022-04-11  0:36     ` Ming Lei [this message]
2022-04-11  0:50       ` Damien Le Moal
2022-04-11  1:04         ` Ming Lei
2022-04-11  1:08           ` Damien Le Moal
2022-04-11  2:19           ` Damien Le Moal
2022-04-11  2:55             ` Damien Le Moal
2022-04-11  3:10               ` Damien Le Moal
2022-04-11  7:34               ` Ming Lei
2022-04-11  7:42                 ` Damien Le Moal
2022-04-11 14:18                   ` Ming Lei
2022-04-11 23:33                     ` Damien Le Moal
2022-04-12  0:09                       ` Ming Lei
2022-04-12  0:28                         ` Damien Le Moal
2022-04-12  1:02                           ` Ming Lei
2022-04-12  1:17                             ` Damien Le Moal
2022-04-11  9:40   ` Damien Le Moal
2022-04-08 17:12 ` [dm-devel] [PATCH 2/3] dm: improve target io referencing Ming Lei
2022-04-08 17:12 ` [dm-devel] [PATCH 3/3] dm: put all polled io into one single list Ming Lei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YlN4BC2qbGODxbVz@T590 \
    --to=ming.lei@redhat.com \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=damien.lemoal@wdc.com \
    --cc=dm-devel@redhat.com \
    --cc=snitzer@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.