From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NATtc-00023q-Ee for qemu-devel@nongnu.org; Tue, 17 Nov 2009 14:39:24 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NATtY-00023J-R4 for qemu-devel@nongnu.org; Tue, 17 Nov 2009 14:39:24 -0500 Received: from [199.232.76.173] (port=36182 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NATtY-00023G-Ky for qemu-devel@nongnu.org; Tue, 17 Nov 2009 14:39:20 -0500 Received: from qw-out-1920.google.com ([74.125.92.148]:62511) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NATtY-0008Pz-B0 for qemu-devel@nongnu.org; Tue, 17 Nov 2009 14:39:20 -0500 Received: by qw-out-1920.google.com with SMTP id 5so100403qwc.4 for ; Tue, 17 Nov 2009 11:39:18 -0800 (PST) Message-ID: <4B02FBE4.2060409@codemonkey.ws> Date: Tue, 17 Nov 2009 13:39:16 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <41be791c0911091004x62d30fbey91ef730475ba3571@mail.gmail.com> In-Reply-To: <41be791c0911091004x62d30fbey91ef730475ba3571@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] qemu-kvm: clear only essential parts of VirtIOBlockReq on object allocation - RESUBMIT List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Saul Tamari Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org 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