From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH] qemu-kvm: clear only essential parts of VirtIOBlockReq on object allocation - RESUBMIT Date: Tue, 17 Nov 2009 13:39:16 -0600 Message-ID: <4B02FBE4.2060409@codemonkey.ws> References: <41be791c0911091004x62d30fbey91ef730475ba3571@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org To: Saul Tamari Return-path: Received: from qw-out-2122.google.com ([74.125.92.27]:46148 "EHLO qw-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751986AbZKQTjM (ORCPT ); Tue, 17 Nov 2009 14:39:12 -0500 Received: by qw-out-2122.google.com with SMTP id 3so102298qwe.37 for ; Tue, 17 Nov 2009 11:39:18 -0800 (PST) In-Reply-To: <41be791c0911091004x62d30fbey91ef730475ba3571@mail.gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: Saul Tamari wrote: > This patch reduces the size of memory being cleared on every virtio-blk IO. > > Improve number of IOPS when using avirtio-blk device. > > On every virtio-blk IO command passed to QEMU, virtio_blk_alloc_request() > allocates and clears (with qemu_mallocz()) a VirtIOBlockReq object. > The sizeof(VirtIOBlockReq) equals 41040 bytes on my x86-64 machine. > By moving the 'elem' variable to the end of VirtIOBlockReq and > clearing only upto the address of the 'elem.in_addr' field, the > memset() call now clears only 80 bytes. > > > Signed-off-by: Saul Tamari > --- > > diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c > index 2630b99..de74b00 100644 > --- a/hw/virtio-blk.c > +++ b/hw/virtio-blk.c > @@ -79,12 +79,13 @@ static inline void virtio_identify_template(struct > virtio_blk_config *bc) > This patch is whitespace damaged by your mailer. Regards, Anthony Liguori