All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junichi Nomura <j-nomura@ce.jp.nec.com>
To: device-mapper development <dm-devel@redhat.com>,
	Jens Axboe <axboe@kernel.dk>, Christoph Hellwig <hch@lst.de>,
	Mike Snitzer <snitzer@redhat.com>
Subject: Re: [PATCH for-4.2 2/3] block, dm: don't copy bios for request clones
Date: Tue, 26 May 2015 06:20:43 +0000	[thread overview]
Message-ID: <556410BB.3000103@ce.jp.nec.com> (raw)
In-Reply-To: <1432300445-9543-2-git-send-email-snitzer@redhat.com>

On 05/22/15 22:14, Mike Snitzer wrote:
> From: Christoph Hellwig <hch@lst.de>
> 
> Currently dm-multipath has to clone the bios for every request sent
> to the lower devices, which wastes cpu cycles and ties down memory.
> 
> This patch instead adds a new REQ_CLONE flag that instructs req_bio_endio
> to not complete bios attached to a request, which we set on clone
> requests similar to bios in a flush sequence.  With this change I/O
> errors on a path failure only get propagated to dm-multipath, which
> can then either resubmit the I/O or complete the bios on the original
> request.
..
> @@ -128,7 +128,8 @@ static void req_bio_endio(struct request *rq, struct bio *bio,
>  	bio_advance(bio, nbytes);
>  
>  	/* don't actually finish bio if it's part of flush sequence */
> -	if (bio->bi_iter.bi_size == 0 && !(rq->cmd_flags & REQ_FLUSH_SEQ))
> +	if (bio->bi_iter.bi_size == 0 &&
> +	    !(rq->cmd_flags & (REQ_FLUSH_SEQ|REQ_CLONE)))
>  		bio_endio(bio, error);
>  }

Not completing bios is not sufficient.
If you advance the bi_iter to the end, you need to somehow rewind it
or the re-submission will be incomplete, that would end up as a data
corruption...

-- 
Jun'ichi Nomura, NEC Corporation

  reply	other threads:[~2015-05-26  6:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-22 13:14 [PATCH for-4.2 1/3] block: remove management of bi_remaining when restoring original bi_end_io Mike Snitzer
2015-05-22 13:14 ` [PATCH for-4.2 2/3] block, dm: don't copy bios for request clones Mike Snitzer
2015-05-26  6:20   ` Junichi Nomura [this message]
2015-05-27  8:21     ` Christoph Hellwig
2015-05-27  9:50       ` Junichi Nomura
2015-05-28  6:38         ` Junichi Nomura
2015-05-29 16:54           ` Christoph Hellwig
2015-06-01  1:14             ` Junichi Nomura
2015-06-03  7:37               ` Christoph Hellwig
2015-06-03 23:13                 ` Junichi Nomura
2015-05-29 16:55         ` Christoph Hellwig
2015-06-01  1:19           ` Junichi Nomura
2015-06-03  7:39             ` Christoph Hellwig
2015-05-22 13:14 ` [PATCH for-4.2 3/3] block: remove export for blk_queue_bio Mike Snitzer

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=556410BB.3000103@ce.jp.nec.com \
    --to=j-nomura@ce.jp.nec.com \
    --cc=axboe@kernel.dk \
    --cc=dm-devel@redhat.com \
    --cc=hch@lst.de \
    --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.