Re: [Qemu-devel] [PATCH 1/1] virtio-blk: Use a req pool instead of malloc/free

2014-03-26 Thread Paolo Bonzini
Il 26/03/2014 10:59, Li, ZhenHua ha scritto: Sorry I am confused . There are two ways now: 1. Just use g_slice_new to replace malloc/free. 2. Use a pool as a replacement of frequently create/destroy reqs. And when create the pool, use g_slice_new. Which are you meaning? I think both I and Ste

Re: [Qemu-devel] [PATCH 1/1] virtio-blk: Use a req pool instead of malloc/free

2014-03-26 Thread Li, ZhenHua
Sorry I am confused . There are two ways now: 1. Just use g_slice_new to replace malloc/free. 2. Use a pool as a replacement of frequently create/destroy reqs. And when create the pool, use g_slice_new. Which are you meaning? Thanks ZhenHua On 03/26/2014 05:55 PM, Paolo Bonzini wrote: Il 26

Re: [Qemu-devel] [PATCH 1/1] virtio-blk: Use a req pool instead of malloc/free

2014-03-26 Thread Paolo Bonzini
Il 26/03/2014 03:02, Li, Zhen-Hua ha scritto: From: "Li, ZhenHua" 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%. Can you try g_slice_new/g_slice_free inst

Re: [Qemu-devel] [PATCH 1/1] virtio-blk: Use a req pool instead of malloc/free

2014-03-26 Thread Li, ZhenHua
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" In virtio-blk module, when there is new request,

Re: [Qemu-devel] [PATCH 1/1] virtio-blk: Use a req pool instead of malloc/free

2014-03-26 Thread Stefan Hajnoczi
On Tue, Mar 25, 2014 at 04:44:48PM +0800, Li, Zhen-Hua wrote: > From: "Li, ZhenHua" > > 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

Re: [Qemu-devel] [PATCH 1/1] virtio-blk: Use a req pool instead of malloc/free

2014-03-25 Thread Li, ZhenHua
I am sorry that seems it was not sent out before I subscribed to the list. So I send this patch again. On 03/26/2014 10:02 AM, Li, Zhen-Hua wrote: From: "Li, ZhenHua" In virtio-blk module, when there is new request, new req structure will be created by malloc. Use a req pool instead of this,

[Qemu-devel] [PATCH 1/1] virtio-blk: Use a req pool instead of malloc/free

2014-03-25 Thread Li, Zhen-Hua
From: "Li, ZhenHua" 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 --- hw/block/virtio-blk.c | 87

[Qemu-devel] [PATCH 1/1] virtio-blk: Use a req pool instead of malloc/free

2014-03-25 Thread Li, Zhen-Hua
From: "Li, ZhenHua" 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 --- hw/block/virtio-blk.c | 87