Re: [Qemu-devel] [PATCH 07/15] dataplane: use object pool to speed up allocation for virtio blk request

2014-08-04 Thread Stefan Hajnoczi
On Fri, Aug 01, 2014 at 03:42:05PM +0800, Ming Lei wrote: On Thu, Jul 31, 2014 at 5:18 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 31/07/2014 05:22, Ming Lei ha scritto: The problem is that g_slice here is not using the slab-style allocator because the object is larger than roughly

Re: [Qemu-devel] [PATCH 07/15] dataplane: use object pool to speed up allocation for virtio blk request

2014-08-04 Thread Ming Lei
On Mon, Aug 4, 2014 at 6:21 PM, Stefan Hajnoczi stefa...@redhat.com wrote: On Fri, Aug 01, 2014 at 03:42:05PM +0800, Ming Lei wrote: On Thu, Jul 31, 2014 at 5:18 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 31/07/2014 05:22, Ming Lei ha scritto: The problem is that g_slice here is not

Re: [Qemu-devel] [PATCH 07/15] dataplane: use object pool to speed up allocation for virtio blk request

2014-08-01 Thread Ming Lei
On Thu, Jul 31, 2014 at 5:18 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 31/07/2014 05:22, Ming Lei ha scritto: The problem is that g_slice here is not using the slab-style allocator because the object is larger than roughly 500 bytes. One solution would be to make

Re: [Qemu-devel] [PATCH 07/15] dataplane: use object pool to speed up allocation for virtio blk request

2014-07-31 Thread Paolo Bonzini
Il 31/07/2014 05:22, Ming Lei ha scritto: The problem is that g_slice here is not using the slab-style allocator because the object is larger than roughly 500 bytes. One solution would be to make virtqueue_pop/vring_pop allocate a VirtQueueElement of the right size (and

[Qemu-devel] [PATCH 07/15] dataplane: use object pool to speed up allocation for virtio blk request

2014-07-30 Thread Ming Lei
g_slice_new(VirtIOBlockReq), its free pair and access the instance is a bit slow since sizeof(VirtIOBlockReq) takes more than 40KB, so use object pool to speed up its allocation and release. With this patch, ~5% throughput improvement is observed in the VM based on server. Signed-off-by: Ming

Re: [Qemu-devel] [PATCH 07/15] dataplane: use object pool to speed up allocation for virtio blk request

2014-07-30 Thread Paolo Bonzini
Il 30/07/2014 13:39, Ming Lei ha scritto: g_slice_new(VirtIOBlockReq), its free pair and access the instance is a bit slow since sizeof(VirtIOBlockReq) takes more than 40KB, so use object pool to speed up its allocation and release. With this patch, ~5% throughput improvement is observed in

Re: [Qemu-devel] [PATCH 07/15] dataplane: use object pool to speed up allocation for virtio blk request

2014-07-30 Thread Michael S. Tsirkin
On Wed, Jul 30, 2014 at 04:14:09PM +0200, Paolo Bonzini wrote: Il 30/07/2014 13:39, Ming Lei ha scritto: g_slice_new(VirtIOBlockReq), its free pair and access the instance is a bit slow since sizeof(VirtIOBlockReq) takes more than 40KB, so use object pool to speed up its allocation and

Re: [Qemu-devel] [PATCH 07/15] dataplane: use object pool to speed up allocation for virtio blk request

2014-07-30 Thread Ming Lei
On Wed, Jul 30, 2014 at 10:14 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 30/07/2014 13:39, Ming Lei ha scritto: g_slice_new(VirtIOBlockReq), its free pair and access the instance is a bit slow since sizeof(VirtIOBlockReq) takes more than 40KB, so use object pool to speed up its allocation