Stefan,

Thank you for your suggestions. I will try g_slice_* and give more performance testing results.

ZhenHua

On 03/26/2014 05:27 PM, Stefan Hajnoczi wrote:
On Tue, Mar 25, 2014 at 04:44:48PM +0800, Li, Zhen-Hua wrote:
From: "Li, ZhenHua" <zhen-h...@hp.com>

In virtio-blk module, when there is new request, new req structure
will be created by malloc.  Use a req pool instead of this, will increase
performance;

Increacement: about 5% to 10%.

Signed-off-by: Li, ZhenHua <zhen-h...@hp.com>
---
  hw/block/virtio-blk.c |   87 ++++++++++++++++++++++++++++++++++++++++++-------
  1 file changed, 75 insertions(+), 12 deletions(-)

Please try g_slice_new() instead of implementing a request pool
manually:
https://developer.gnome.org/glib/unstable/glib-Memory-Slices.html

We already use g_slice_new() in other places in QEMU - for example in
the virtio-blk dataplane code.

Also please provide more details about the benchmark you are running.
Which benchmark, what workload/settings, 5-10% increase of which number
(IOPS, BW/CPU%, or something else), etc.

Stefan



Reply via email to