Commit 11dfce509eaa35e8fc81cb50d0910c0e235fd7e2

Authored by Junichi Nomura
Committed by Jens Axboe
1 parent 4a0efdc933

block: use bio_clone_fast() in blk_rq_prep_clone()

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 <j-nomura@ce.jp.nec.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -2926,7 +2926,7 @@
2926 2926 blk_rq_init(NULL, rq);
2927 2927  
2928 2928 __rq_for_each_bio(bio_src, rq_src) {
2929   - bio = bio_clone_bioset(bio_src, gfp_mask, bs);
  2929 + bio = bio_clone_fast(bio_src, gfp_mask, bs);
2930 2930 if (!bio)
2931 2931 goto free_and_out;
2932 2932