Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1038747AbdDULaq (ORCPT ); Fri, 21 Apr 2017 07:30:46 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:37212 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1034349AbdDULao (ORCPT ); Fri, 21 Apr 2017 07:30:44 -0400 Date: Fri, 21 Apr 2017 04:30:43 -0700 From: Christoph Hellwig To: NeilBrown Cc: Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Philipp Reisner , Lars Ellenberg , drbd-dev@lists.linbit.com Subject: Re: [PATCH 06/11] drbd: use bio_clone_fast() instead of bio_clone() Message-ID: <20170421113043.GF12523@infradead.org> References: <149266645258.27388.14083229348123176454.stgit@noble> <149266672944.27388.18032655582081459017.stgit@noble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <149266672944.27388.18032655582081459017.stgit@noble> User-Agent: Mutt/1.8.0 (2017-02-23) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 888 Lines: 23 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 All the zeroing of the gblobal variable looks unessecary / stupid. But given that the surrounding code already does it: Reviewed-by: Christoph Hellwig > + bio = bio_clone_fast(bio_src, GFP_NOIO, drbd_io_bio_set); /* XXX cannot fail!! */ but maybe I'd drop this comment..