From: Peter Lieven <pl@kamp.de>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, famz@redhat.com, benoit@irqsave.net,
ming.lei@canonical.com, Peter Lieven <pl@kamp.de>,
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
Date: Mon, 2 Feb 2015 14:52:22 +0100 [thread overview]
Message-ID: <1422885142-6391-6-git-send-email-pl@kamp.de> (raw)
In-Reply-To: <1422885142-6391-1-git-send-email-pl@kamp.de>
this adds a knob to disable request merging for debugging or benchmarks if dedired.
Signed-off-by: Peter Lieven <pl@kamp.de>
---
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;
--
1.9.1
next prev parent reply other threads:[~2015-02-02 13:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-02 13:52 [Qemu-devel] [PATCH v4 0/5] this series adds the long missing multiread support to virtio-blk Peter Lieven
2015-02-02 13:52 ` [Qemu-devel] [PATCH v4 1/5] block: add accounting for merged requests Peter Lieven
2015-02-02 13:52 ` [Qemu-devel] [PATCH v4 2/5] hw/virtio-blk: add a constant for max number of " Peter Lieven
2015-02-02 13:52 ` [Qemu-devel] [PATCH v4 3/5] block-backend: expose bs->bl.max_transfer_length Peter Lieven
2015-02-02 13:52 ` [Qemu-devel] [PATCH v4 4/5] virtio-blk: introduce multiread Peter Lieven
2015-02-02 13:52 ` Peter Lieven [this message]
2015-02-02 16:09 ` [Qemu-devel] [PATCH v4 0/5] this series adds the long missing multiread support to virtio-blk Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1422885142-6391-6-git-send-email-pl@kamp.de \
--to=pl@kamp.de \
--cc=armbru@redhat.com \
--cc=benoit@irqsave.net \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=ming.lei@canonical.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).