qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v1 02/17] dataplane: use object pool to speed up


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v1 02/17] dataplane: use object pool to speed up allocation for virtio blk request
Date: Tue, 05 Aug 2014 06:30:42 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0

On 08/04/2014 09:33 PM, Ming Lei wrote:
> g_slice_new(VirtIOBlockReq), its free pair and access the instance

Took me a while to read this.  Maybe:

Calling g_slice_new(VirtIOBlockReq) and its free pair, and accessing the
instance, are a bit slow...

> 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%-10% throughput improvement is observed in the VM
> based on server.
> 
> Signed-off-by: Ming Lei <address@hidden>
> ---
>  hw/block/dataplane/virtio-blk.c |   12 ++++++++++++
>  hw/block/virtio-blk.c           |   13 +++++++++++--
>  include/hw/virtio/virtio-blk.h  |    2 ++
>  3 files changed, 25 insertions(+), 2 deletions(-)

> @@ -50,6 +52,10 @@ struct VirtIOBlockDataPlane {
>      Error *blocker;
>      void (*saved_complete_request)(struct VirtIOBlockReq *req,
>                                     unsigned char status);
> +
> +    VirtIOBlockReq  reqs[REQ_POOL_SZ];
> +    void *free_reqs[REQ_POOL_SZ];
> +    ObjPool  req_pool;

Why two instances of double spaces?

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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