From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Snitzer Subject: [PATCH v2 2/4] block: use bio_clone_fast() in blk_rq_prep_clone() Date: Fri, 3 Oct 2014 17:27:11 -0400 Message-ID: <1412371633-30356-2-git-send-email-snitzer@redhat.com> References: <1412371633-30356-1-git-send-email-snitzer@redhat.com> Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1412371633-30356-1-git-send-email-snitzer@redhat.com> In-Reply-To: <20141003204852.GA14135@redhat.com> References: <20141003204852.GA14135@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: snitzer@redhat.com, Junichi Nomura , Jens Axboe Cc: dm-devel@redhat.com, Kent Overstreet List-Id: dm-devel.ids From: Junichi Nomura Request cloning clones bios in the request to track the completion of each bio. For that purpose, we can use bio_clone_fast() instead of bio_clone() to avoid unnecessary allocation and copy of bvecs. This patch reduces memory footprint of request-based device-mapper (about 1-4KB for each request) and is a preparation for further reduction of memory usage by removing unused bvec mempool. Signed-off-by: Jun'ichi Nomura Signed-off-by: Mike Snitzer --- block/blk-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-core.c b/block/blk-core.c index bf930f4..a92f720 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -2931,7 +2931,7 @@ int blk_rq_prep_clone(struct request *rq, struct request *rq_src, blk_rq_init(NULL, rq); __rq_for_each_bio(bio_src, rq_src) { - bio = bio_clone_bioset(bio_src, gfp_mask, bs); + bio = bio_clone_fast(bio_src, gfp_mask, bs); if (!bio) goto free_and_out; -- 1.9.3