aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2015-10-21 16:34:20 -0400
committerMike Snitzer <snitzer@redhat.com>2015-10-31 19:06:02 -0400
commitdbba42d8a9ebddcc1c1412e8457f79f3cb6ef6e7 (patch)
treeaa185bdeae4a2b11d875cb2a21dac8c23608e1bf
parenta3d939ae7b5f82688a6d3450f95286eaea338328 (diff)
dm: eliminate unused "bioset" process for each bio-based DM device
Commit 54efd50bfd873e2dbf784e0b21a8027ba4299a3e ("block: make generic_make_request handle arbitrarily sized bios") makes it possible for block devices to process large bios. In doing so that commit allocates a new queue->bio_split bioset for each block device, this bioset is used for allocating bios when the driver needs to split large bios. Each bioset allocates a workqueue process, thus the above commit increases the number of processes allocated per block device. DM doesn't need the queue->bio_split bioset, thus we can deallocate it. This reduces the number of allocated processes per bio-based DM device from 3 to 2. Also remove the call to blk_queue_split(), it is not needed because DM does its own splitting. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
-rw-r--r--drivers/md/dm.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 95558432c080..64b50b71400f 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1763,8 +1763,6 @@ static void dm_make_request(struct request_queue *q, struct bio *bio)
1763 1763
1764 map = dm_get_live_table(md, &srcu_idx); 1764 map = dm_get_live_table(md, &srcu_idx);
1765 1765
1766 blk_queue_split(q, &bio, q->bio_split);
1767
1768 generic_start_io_acct(rw, bio_sectors(bio), &dm_disk(md)->part0); 1766 generic_start_io_acct(rw, bio_sectors(bio), &dm_disk(md)->part0);
1769 1767
1770 /* if we're suspended, we have to queue this io for later */ 1768 /* if we're suspended, we have to queue this io for later */
@@ -2792,6 +2790,12 @@ int dm_setup_md_queue(struct mapped_device *md)
2792 case DM_TYPE_BIO_BASED: 2790 case DM_TYPE_BIO_BASED:
2793 dm_init_old_md_queue(md); 2791 dm_init_old_md_queue(md);
2794 blk_queue_make_request(md->queue, dm_make_request); 2792 blk_queue_make_request(md->queue, dm_make_request);
2793 /*
2794 * DM handles splitting bios as needed. Free the bio_split bioset
2795 * since it won't be used (saves 1 process per bio-based DM device).
2796 */
2797 bioset_free(md->queue->bio_split);
2798 md->queue->bio_split = NULL;
2795 break; 2799 break;
2796 } 2800 }
2797 2801