From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3Jwm-0003f9-0y for qemu-devel@nongnu.org; Mon, 30 Nov 2015 03:36:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3Jwl-0000PB-A6 for qemu-devel@nongnu.org; Mon, 30 Nov 2015 03:36:31 -0500 Sender: Paolo Bonzini References: <1448388091-117282-1-git-send-email-pbonzini@redhat.com> <1448388091-117282-8-git-send-email-pbonzini@redhat.com> <20151130032436.GF10896@ad.usersys.redhat.com> From: Paolo Bonzini Message-ID: <565C0A86.8080706@redhat.com> Date: Mon, 30 Nov 2015 09:36:22 +0100 MIME-Version: 1.0 In-Reply-To: <20151130032436.GF10896@ad.usersys.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 07/40] virtio: slim down allocation of VirtQueueElements List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org On 30/11/2015 04:24, Fam Zheng wrote: > > + for (i = 0; i < out_num; i++) { > > + elem->out_addr[i] = addr[i]; > > + elem->out_sg[i] = iov[i]; > > + } > > Isn't memcpy more efficient here? Otherwise looks good. Probably not, out_num/in_num is usually very small, in fact one of them is often 0 or 1. For example the memcpy in address_space_rw is awfully inefficient. This is roughly the same. Paolo