Re: [Qemu-devel] [PATCH] iov: avoid memcpy for "simple" iov_from_buf/iov_to_buf

2015-12-22 Thread Stefan Hajnoczi
On Fri, Dec 18, 2015 at 01:08:43PM +0800, Stefan Hajnoczi wrote: > On Wed, Dec 16, 2015 at 11:57:33AM +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.

Re: [Qemu-devel] [PATCH] iov: avoid memcpy for "simple" iov_from_buf/iov_to_buf

2015-12-17 Thread Stefan Hajnoczi
On Wed, Dec 16, 2015 at 11:57:33AM +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 c

[Qemu-devel] [PATCH] iov: avoid memcpy for "simple" iov_from_buf/iov_to_buf

2015-12-16 Thread Paolo Bonzini
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