From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
ming.lei@canonical.com, Fam Zheng <famz@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PATCH v2 3/4] virtio-blk: avoid g_slice_new0() for VirtIOBlockReq and VirtQueueElement
Date: Tue, 1 Jul 2014 17:25:08 +0200 [thread overview]
Message-ID: <1404228309-21122-4-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1404228309-21122-1-git-send-email-stefanha@redhat.com>
In commit de6c8042ec55da18702fa51f09072fcaa315edc3 ("virtio-blk: Avoid
zeroing every request structure") we avoided the 40 KB memset when
allocating VirtIOBlockReq.
The memset was reintroduced in commit
671ec3f056559f22a2531a91dce3a258b9b5eb8a ("virtio-blk: Convert
VirtIOBlockReq.elem to pointer").
It must be fixed again to avoid a performance regression.
Cc: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
hw/block/virtio-blk.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index aec3146..b06a56d 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -31,9 +31,11 @@
static VirtIOBlockReq *virtio_blk_alloc_request(VirtIOBlock *s)
{
- VirtIOBlockReq *req = g_slice_new0(VirtIOBlockReq);
+ VirtIOBlockReq *req = g_slice_new(VirtIOBlockReq);
req->dev = s;
- req->elem = g_slice_new0(VirtQueueElement);
+ req->qiov.size = 0;
+ req->next = NULL;
+ req->elem = g_slice_new(VirtQueueElement);
return req;
}
--
1.9.3
next prev parent reply other threads:[~2014-07-01 15:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-01 15:25 [Qemu-devel] [PATCH v2 0/4] virtio-blk: fix issues with unified virtio-blk request handling Stefan Hajnoczi
2014-07-01 15:25 ` [Qemu-devel] [PATCH v2 1/4] virtio-blk: avoid dataplane VirtIOBlockReq early free Stefan Hajnoczi
2014-07-01 15:25 ` [Qemu-devel] [PATCH v2 2/4] dataplane: do not free VirtQueueElement in vring_push() Stefan Hajnoczi
2014-07-01 15:25 ` Stefan Hajnoczi [this message]
2014-07-01 15:25 ` [Qemu-devel] [PATCH v2 4/4] virtio-blk: embed VirtQueueElement in VirtIOBlockReq Stefan Hajnoczi
2014-07-02 8:25 ` [Qemu-devel] [PATCH v2 0/4] virtio-blk: fix issues with unified virtio-blk request handling Christian Borntraeger
2014-07-03 15:41 ` Stefan Hajnoczi
2014-07-08 14:43 ` Stefan Hajnoczi
2014-07-08 15:14 ` Kevin Wolf
2014-07-09 7:56 ` Stefan Hajnoczi
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=1404228309-21122-4-git-send-email-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=ming.lei@canonical.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).