From patchwork Mon Feb 2 13:52:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Lieven X-Patchwork-Id: 435520 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id AD7811402AC for ; Tue, 3 Feb 2015 01:01:11 +1100 (AEDT) Received: from localhost ([::1]:54770 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIHYr-0000jm-NT for incoming@patchwork.ozlabs.org; Mon, 02 Feb 2015 09:01:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIHTo-0001fO-4l for qemu-devel@nongnu.org; Mon, 02 Feb 2015 08:55:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YIHTh-00069f-AS for qemu-devel@nongnu.org; Mon, 02 Feb 2015 08:55:56 -0500 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:46041 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIHTh-00068T-0L for qemu-devel@nongnu.org; Mon, 02 Feb 2015 08:55:49 -0500 Received: (qmail 6581 invoked by uid 89); 2 Feb 2015 13:55:48 -0000 Received: from [82.141.1.145] by client-16-kamp (envelope-from , uid 89) with qmail-scanner-2010/03/19-MF (clamdscan: 0.98.6/20018. hbedv: 8.3.28.14/7.11.206.130. spamassassin: 3.4.0. Clear:RC:1(82.141.1.145):SA:0(-1.2/5.0):. Processed in 0.992864 secs); 02 Feb 2015 13:55:48 -0000 Received: from ns.kamp-intra.net (HELO dns.kamp-intra.net) ([82.141.1.145]) by mx01.kamp.de with SMTP; 2 Feb 2015 13:55:47 -0000 X-GL_Whitelist: yes Received: from lieven-vm-neu (lieven-vm.kamp-intra.net [172.21.12.69]) by dns.kamp-intra.net (Postfix) with ESMTP id 02E9B206AD; Mon, 2 Feb 2015 14:52:45 +0100 (CET) Received: by lieven-vm-neu (Postfix, from userid 1000) id CA22E2094F; Mon, 2 Feb 2015 14:52:23 +0100 (CET) From: Peter Lieven To: qemu-devel@nongnu.org Date: Mon, 2 Feb 2015 14:52:22 +0100 Message-Id: <1422885142-6391-6-git-send-email-pl@kamp.de> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1422885142-6391-1-git-send-email-pl@kamp.de> References: <1422885142-6391-1-git-send-email-pl@kamp.de> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a02:248:0:51::16 Cc: kwolf@redhat.com, famz@redhat.com, benoit@irqsave.net, ming.lei@canonical.com, Peter Lieven , armbru@redhat.com, mreitz@redhat.com, stefanha@redhat.com, pbonzini@redhat.com Subject: [Qemu-devel] [PATCH v4 5/5] virtio-blk: add a knob to disable request merging X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org this adds a knob to disable request merging for debugging or benchmarks if dedired. Signed-off-by: Peter Lieven --- hw/block/virtio-blk.c | 5 ++++- include/hw/virtio/virtio-blk.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index d0a01a8..8c51a29 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -531,7 +531,8 @@ void virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb) /* merge would exceed maximum number of requests or IO direction * changes */ if (mrb->num_reqs > 0 && (mrb->num_reqs == VIRTIO_BLK_MAX_MERGE_REQS || - is_write != mrb->is_write)) { + is_write != mrb->is_write || + !req->dev->conf.request_merging)) { virtio_blk_submit_multireq(req->dev->blk, mrb); } @@ -950,6 +951,8 @@ static Property virtio_blk_properties[] = { #ifdef __linux__ DEFINE_PROP_BIT("scsi", VirtIOBlock, conf.scsi, 0, true), #endif + DEFINE_PROP_BIT("request-merging", VirtIOBlock, conf.request_merging, 0, + true), DEFINE_PROP_BIT("x-data-plane", VirtIOBlock, conf.data_plane, 0, false), DEFINE_PROP_END_OF_LIST(), }; diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h index 2027a64..fc7d311 100644 --- a/include/hw/virtio/virtio-blk.h +++ b/include/hw/virtio/virtio-blk.h @@ -113,6 +113,7 @@ struct VirtIOBlkConf uint32_t scsi; uint32_t config_wce; uint32_t data_plane; + uint32_t request_merging; }; struct VirtIOBlockDataPlane;