Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1628165

Re: [PATCH 06/11] drbd: use bio_clone_fast() instead of bio_clone()

From Christoph Hellwig <hch@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH 06/11] drbd: use bio_clone_fast() instead of bio_clone()
Date 2017-04-21 13:40 +0200
Message-ID <tyF4S-5fu-21@gated-at.bofh.it> (permalink)
References <tyd8C-4Wq-7@gated-at.bofh.it> <tyd8D-4Wq-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Apr 20, 2017 at 03:38:49PM +1000, NeilBrown wrote:
> drbd does not modify the bi_io_vec of the cloned bio,
> so there is no need to clone that part.  So bio_clone_fast()
> is the better choice.
> For bio_clone_fast() we need to specify a bio_set.
> We could use fs_bio_set, which bio_clone() uses, or
> drbd_md_io_bio_set, which drbd uses for metadata, but it is
> generally best to avoid sharing bio_sets unless you can
> be certain that there are no interdependencies.
> 
> So create a new bio_set, drbd_io_bio_set, and use bio_clone_fast().
> 
> Signed-off-by: NeilBrown <neilb@suse.com>

All the zeroing of the gblobal variable looks unessecary / stupid.

But given that the surrounding code already does it:

Reviewed-by: Christoph Hellwig <hch@lst.de>

> +	bio = bio_clone_fast(bio_src, GFP_NOIO, drbd_io_bio_set); /* XXX cannot fail!! */

but maybe I'd drop this comment..

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 06/11] drbd: use bio_clone_fast() instead of bio_clone() NeilBrown <neilb@suse.com> - 2017-04-20 07:50 +0200
  Re: [PATCH 06/11] drbd: use bio_clone_fast() instead of bio_clone() Christoph Hellwig <hch@infradead.org> - 2017-04-21 13:40 +0200

csiph-web