[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] iov: avoid memcpy for "simple" iov_from_buf/
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v2] iov: avoid memcpy for "simple" iov_from_buf/iov_to_buf |
Date: |
Wed, 23 Dec 2015 12:45:55 +0800 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
On Tue, Dec 22, 2015 at 12:03:33PM +0100, Paolo Bonzini wrote:
> memcpy can take a large amount of time for small reads and writes.
> For virtio it is a common case that the first iovec can satisfy the
> whole read or write. In that case, and if bytes is a constant to
> avoid excessive growth of code, inline the first iteration
> into the caller.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> v1->v2: check for overflow in offset + bytes, which
> is covered by test-iov
>
> include/qemu/iov.h | 34 ++++++++++++++++++++++++++++++----
> util/iov.c | 8 ++++----
> 2 files changed, 34 insertions(+), 8 deletions(-)
Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block
Stefan
signature.asc
Description: PGP signature