From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754564AbbFOLSl (ORCPT ); Mon, 15 Jun 2015 07:18:41 -0400 Received: from smtpbgsg2.qq.com ([54.254.200.128]:43306 "EHLO smtpbgsg2.qq.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754171AbbFOLSd (ORCPT ); Mon, 15 Jun 2015 07:18:33 -0400 X-QQ-mid: bizesmtp8t1434367105t903t172 X-QQ-SSF: 0140000000200010F322B00A0000000 X-QQ-FEAT: JNrLgFxDiy11On11P9SiCaOO+7ceQ4hpOE6WpkYGsrCq+zwsOARsUf4dCdDQ3 B65Xs7stsfBoaPmqZX+XJTFqLbK+GVGqtH2HECEKKh5P/gGvghMyUdEh/c8Zj+Gf55MEzDt DvDxV4ptXxUeAWho26LCeTD7BhDF7nY1zgxWIewWlmD8/6btT8lG0RMWzkqWW+yIIk0gN9T S2ke6U9K7iJoCBZoRuFPu5/SlBzSGExXLZrIF6ToIXwuiDxd0eG+P X-QQ-GoodBg: 2 Message-ID: <557EB47F.6090708@unitedstack.com> Date: Mon, 15 Jun 2015 19:18:23 +0800 From: juncheng bai User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: idryomov@redhat.com, elder@linaro.org, josh.durgin@inktank.com, lucienchao@gmail.com CC: jeff@garzik.org, yehuda@hq.newdream.net, sage@newdream.net, elder@inktank.com, linux-kernel@vger.kernel.org, ceph-devel@vger.kernel.org Subject: [PATCH RFC] storage:rbd: make the size of request is equal to the, size of the object Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-QQ-SENDSIZE: 520 X-QQ-Bgrelay: 1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From 6213215bd19926d1063d4e01a248107dab8a899b Mon Sep 17 00:00:00 2001 From: juncheng bai Date: Mon, 15 Jun 2015 18:34:00 +0800 Subject: [PATCH] storage:rbd: make the size of request is equal to the size of the object ensures that the merged size of request can achieve the size of the object. when merge a bio to request or merge a request to request, the sum of the segment number of the current request and the segment number of the bio is not greater than the max segments of the request, so the max size of request is 512k if the max segments of request is BLK_MAX_SEGMENTS. Signed-off-by: juncheng bai --- drivers/block/rbd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 0a54c58..dec6045 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -3757,6 +3757,8 @@ static int rbd_init_disk(struct rbd_device *rbd_dev) segment_size = rbd_obj_bytes(&rbd_dev->header); blk_queue_max_hw_sectors(q, segment_size / SECTOR_SIZE); blk_queue_max_segment_size(q, segment_size); + if (segment_size > BLK_MAX_SEGMENTS * PAGE_SIZE) + blk_queue_max_segments(q, segment_size / PAGE_SIZE); blk_queue_io_min(q, segment_size); blk_queue_io_opt(q, segment_size); --