[Spice-commits] server/reds-stream.c

Frediano Ziglio fziglio at kemper.freedesktop.org
Thu Mar 23 12:09:40 UTC 2017


 server/reds-stream.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 186b8439ae9a7bb5178ca604571e2ed2f4edbfdf
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Mon Mar 13 09:40:33 2017 +0000

    reds-stream: Small syscall optimisation
    
    Handle single chunk writev as normal write.
    From some test more than 60% of the times writev is called with 1 as
    counter. We can easily and very cheaply turn this call to a simpler
    write avoiding the need to pass the array to the kernel.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/server/reds-stream.c b/server/reds-stream.c
index 8ac296d2..77f9424d 100644
--- a/server/reds-stream.c
+++ b/server/reds-stream.c
@@ -308,7 +308,7 @@ ssize_t reds_stream_writev(RedsStream *s, const struct iovec *iov, int iovcnt)
     int n;
     ssize_t ret = 0;
 
-    if (s->priv->writev != NULL) {
+    if (s->priv->writev != NULL && iovcnt > 1) {
         return s->priv->writev(s, iov, iovcnt);
     }
 


More information about the Spice-commits mailing list