From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41787) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aS7JX-00072h-4c for qemu-devel@nongnu.org; Sat, 06 Feb 2016 13:10:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aS7JW-0004hf-3c for qemu-devel@nongnu.org; Sat, 06 Feb 2016 13:10:31 -0500 Date: Sat, 6 Feb 2016 20:10:16 +0200 From: "Michael S. Tsirkin" Message-ID: <20160206200932-mutt-send-email-mst@redhat.com> References: <1454612376-7072-1-git-send-email-mst@redhat.com> <1454612376-7072-7-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PULL 06/49] virtio: move allocation to virtqueue_pop/vring_pop List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Kevin Wolf , Gerd Hoffmann , Eduardo Habkost , Qemu-block , Jason Wang , QEMU Developers , Amit Shah , "Aneesh Kumar K.V" , Stefan Hajnoczi , Cornelia Huck , Paolo Bonzini , Greg Kurz On Fri, Feb 05, 2016 at 12:52:55PM +0000, Peter Maydell wrote: > On 4 February 2016 at 21:51, Michael S. Tsirkin wrote: > > From: Paolo Bonzini > > > > The return code of virtqueue_pop/vring_pop is unused except to check for > > errors or 0. We can thus easily move allocation inside the functions > > and just return a pointer to the VirtQueueElement. > > > > The advantage is that we will be able to allocate only the space that > > is needed for the actual size of the s/g list instead of the full > > VIRTQUEUE_MAX_SIZE items. Currently VirtQueueElement takes about 48K > > of memory, and this kind of allocation puts a lot of stress on malloc. > > By cutting the size by two or three orders of magnitude, malloc can > > use much more efficient algorithms. > > > > The patch is pretty large, but changes to each device are testable > > more or less independently. Splitting it would mostly add churn. > > > > Signed-off-by: Paolo Bonzini > > Reviewed-by: Michael S. Tsirkin > > Signed-off-by: Michael S. Tsirkin > > Reviewed-by: Cornelia Huck > > --- > > hw/9pfs/virtio-9p.h | 2 +- > > include/hw/virtio/dataplane/vring.h | 2 +- > > include/hw/virtio/virtio-balloon.h | 2 +- > > include/hw/virtio/virtio-blk.h | 3 +- > > include/hw/virtio/virtio-net.h | 2 +- > > include/hw/virtio/virtio-scsi.h | 2 +- > > include/hw/virtio/virtio-serial.h | 2 +- > > include/hw/virtio/virtio.h | 2 +- > > hw/9pfs/9p.c | 2 +- > > hw/9pfs/virtio-9p-device.c | 17 ++++---- > > hw/block/dataplane/virtio-blk.c | 11 +++-- > > hw/block/virtio-blk.c | 15 +++---- > > hw/char/virtio-serial-bus.c | 80 +++++++++++++++++++++++-------------- > > hw/display/virtio-gpu.c | 21 ++++++---- > > hw/input/virtio-input.c | 24 +++++++---- > > hw/net/virtio-net.c | 69 ++++++++++++++++++++------------ > > hw/scsi/virtio-scsi-dataplane.c | 15 +++---- > > hw/scsi/virtio-scsi.c | 18 ++++----- > > hw/virtio/dataplane/vring.c | 18 +++++---- > > hw/virtio/virtio-balloon.c | 22 ++++++---- > > hw/virtio/virtio-rng.c | 10 +++-- > > hw/virtio/virtio.c | 12 ++++-- > > roms/seabios | 2 +- > > 23 files changed, 210 insertions(+), 143 deletions(-) > > > --- a/roms/seabios > > +++ b/roms/seabios > > @@ -1 +1 @@ > > -Subproject commit 01a84bea2d28a19d2405c1ecac4bdef17683cc0c > > +Subproject commit 33fbe13a3e2a01e0ba1087a8feed801a0451db21 > > -- > > MST > > Hi. This commit in this pull request includes a seabios submodule > update, but the commit message says nothing about it. Is it > really supposed to be here? > > thanks > -- PMM Not sure how it got here - I didn't notice. I'll redo the pull request. -- MST