aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJosh Durgin <josh.durgin@dreamhost.com>2011-07-22 14:35:23 -0400
committerSage Weil <sage@newdream.net>2011-07-26 14:29:35 -0400
commit029bcbd8b076fd19787b8c73e58dd0a6f2c0caf1 (patch)
tree305128db78ecfb09e6a236caeeac1fbb9ece1175 /drivers
parente9852227431a0ed6ceda064f33e4218757acab6c (diff)
rbd: set blk_queue request sizes to object size
This improves performance since more requests can be merged. Reviewed-by: Yehuda Sadeh <yehuda@hq.newdream.net> Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/rbd.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 7392d7af7eab..15f65b5f3fc7 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -630,6 +630,14 @@ static int rbd_get_num_segments(struct rbd_image_header *header,
630} 630}
631 631
632/* 632/*
633 * returns the size of an object in the image
634 */
635static u64 rbd_obj_bytes(struct rbd_image_header *header)
636{
637 return 1 << header->obj_order;
638}
639
640/*
633 * bio helpers 641 * bio helpers
634 */ 642 */
635 643
@@ -1765,6 +1773,13 @@ static int rbd_init_disk(struct rbd_device *rbd_dev)
1765 q = blk_init_queue(rbd_rq_fn, &rbd_dev->lock); 1773 q = blk_init_queue(rbd_rq_fn, &rbd_dev->lock);
1766 if (!q) 1774 if (!q)
1767 goto out_disk; 1775 goto out_disk;
1776
1777 /* set io sizes to object size */
1778 blk_queue_max_hw_sectors(q, rbd_obj_bytes(&rbd_dev->header) / 512ULL);
1779 blk_queue_max_segment_size(q, rbd_obj_bytes(&rbd_dev->header));
1780 blk_queue_io_min(q, rbd_obj_bytes(&rbd_dev->header));
1781 blk_queue_io_opt(q, rbd_obj_bytes(&rbd_dev->header));
1782
1768 blk_queue_merge_bvec(q, rbd_merge_bvec); 1783 blk_queue_merge_bvec(q, rbd_merge_bvec);
1769 disk->queue = q; 1784 disk->queue = q;
1770 1785