From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=50817 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OEOzz-0002Ew-LQ for qemu-devel@nongnu.org; Tue, 18 May 2010 11:46:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OEOzx-0006WR-0N for qemu-devel@nongnu.org; Tue, 18 May 2010 11:46:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38706) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OEOzw-0006W6-PX for qemu-devel@nongnu.org; Tue, 18 May 2010 11:46:24 -0400 Message-ID: <4BF2B64A.4080709@redhat.com> Date: Tue, 18 May 2010 17:46:18 +0200 From: Jes Sorensen MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] virtio-blk: Avoid zeroing every request structure References: <1273873950-25756-1-git-send-email-stefanha@linux.vnet.ibm.com> In-Reply-To: <1273873950-25756-1-git-send-email-stefanha@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org On 05/14/10 23:52, Stefan Hajnoczi wrote: > The VirtIOBlockRequest structure is about 40 KB in size. This patch > avoids zeroing every request by only initializing fields that are read. > The other fields are either written to or may not be used at all. > > Oprofile shows about 10% of CPU samples in memset called by > virtio_blk_alloc_request(). The workload is > dd if=/dev/vda of=/dev/null iflag=direct bs=8k running concurrently 4 > times. This patch makes memset disappear to the bottom of the profile. > > Signed-off-by: Stefan Hajnoczi Great catch! I ran some benchmarks using a ramdisk passed to the guest as a virtio device and with this patch I saw improvements ranging from 5-20%. I believe the fluctuations are due to not being able to numa bind it due to limited memory. However a win all the way round! Acked-by: Jes Sorensen Jes