[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH] qemu-kvm: clear only essential parts of VirtIOB

From: Anthony Liguori
Subject: [Qemu-devel] Re: [PATCH] qemu-kvm: clear only essential parts of VirtIOBlockReq on object allocation - RESUBMIT
Date: Tue, 17 Nov 2009 13:39:16 -0600
User-agent: Thunderbird (X11/20090825)

Saul Tamari wrote:
This patch reduces the size of memory being cleared on every virtio-blk IO.

Improve number of IOPS when using avirtio-blk device.

On every virtio-blk IO command passed to QEMU, virtio_blk_alloc_request()
allocates and clears (with qemu_mallocz()) a VirtIOBlockReq object.
The sizeof(VirtIOBlockReq) equals 41040 bytes on my x86-64 machine.
By moving the 'elem' variable to the end of VirtIOBlockReq and
clearing only upto the address of the 'elem.in_addr' field, the
memset() call now clears only 80 bytes.

Signed-off-by: Saul Tamari <address@hidden>

diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index 2630b99..de74b00 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -79,12 +79,13 @@ static inline void virtio_identify_template(struct
virtio_blk_config *bc)

This patch is whitespace damaged by your mailer.


Anthony Liguori

reply via email to

[Prev in Thread] Current Thread [Next in Thread]