Received: from eggs.gnu.org ([2001:4830:134:3::10]:36147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLYgH-0003Cf-T7 for qemu-devel@nongnu.org; Tue, 19 Jan 2016 10:58:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLYgC-0005Xu-Pt for qemu-devel@nongnu.org; Tue, 19 Jan 2016 10:58:53 -0500 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:40477) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLYgC-0005Wa-GU for qemu-devel@nongnu.org; Tue, 19 Jan 2016 10:58:48 -0500 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 19 Jan 2016 15:58:45 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id EFDA717D8059 for ; Tue, 19 Jan 2016 15:58:47 +0000 (GMT) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u0JFwgkI47775998 for ; Tue, 19 Jan 2016 15:58:43 GMT Received: from d06av01.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u0JFwgVg025858 for ; Tue, 19 Jan 2016 08:58:42 -0700 Date: Tue, 19 Jan 2016 16:58:40 +0100 From: Cornelia Huck Message-ID: <20160119165840.29a0b394.cornelia.huck@de.ibm.com> In-Reply-To: <1452861718-25806-7-git-send-email-pbonzini@redhat.com> References: <1452861718-25806-1-git-send-email-pbonzini@redhat.com> <1452861718-25806-7-git-send-email-pbonzini@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 06/10] vring: slim down allocation of VirtQueueElements List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, mst@redhat.com On Fri, 15 Jan 2016 13:41:54 +0100 Paolo Bonzini wrote: > Build the addresses and s/g lists on the stack, and then copy them > to a VirtQueueElement that is just as big as required to contain this > particular s/g list. The cost of the copy is minimal compared to that > of a large malloc. > > Signed-off-by: Paolo Bonzini > --- > hw/virtio/dataplane/vring.c | 53 ++++++++++++++++++++++++++++++--------------- > 1 file changed, 36 insertions(+), 17 deletions(-) Reviewed-by: Cornelia Huck