Re: [PATCH for-4.2 2/3] block, dm: don't copy bios for request clones

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/22/15 22:14, Mike Snitzer wrote:
> From: Christoph Hellwig <hch@xxxxxx>
> 
> 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

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux