From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36319) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIbkN-0006gC-FE for qemu-devel@nongnu.org; Thu, 21 Mar 2013 05:25:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIbkM-0003Mj-4B for qemu-devel@nongnu.org; Thu, 21 Mar 2013 05:25:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42655) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIbkL-0003Lg-S6 for qemu-devel@nongnu.org; Thu, 21 Mar 2013 05:25:18 -0400 Message-ID: <514AD1F8.2060808@redhat.com> Date: Thu, 21 Mar 2013 10:25:12 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1363856971-4601-1-git-send-email-owasserm@redhat.com> <1363856971-4601-11-git-send-email-owasserm@redhat.com> In-Reply-To: <1363856971-4601-11-git-send-email-owasserm@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC 10/12] Add qemu_put_buffer_no_copy List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Orit Wasserman Cc: mst@redhat.com, chegu_vinod@hp.com, qemu-devel@nongnu.org, quintela@redhat.com Il 21/03/2013 10:09, Orit Wasserman ha scritto: > + f->iov[f->iovcnt].iov_base = (uint8_t *)buf; > + f->iov[f->iovcnt++].iov_len = size; > + > + f->is_write = 1; > + f->bytes_xfer += size; > + > + if (f->buf_index >= IO_BUF_SIZE || f->iovcnt >= MAX_IOV_SIZE) { > + qemu_fflush(f); > } It should not be complex to check if f->iov[f->iovcnt - 1] can be extended? This could remove many system calls when you have many consecutive zero pages. Paolo