[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] virtio-blk: Avoid zeroing every request struct
From: |
Corentin Chary |
Subject: |
Re: [Qemu-devel] [PATCH] virtio-blk: Avoid zeroing every request structure |
Date: |
Tue, 18 May 2010 18:37:42 +0200 |
On Fri, May 14, 2010 at 11:52 PM, Stefan Hajnoczi
<address@hidden> 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.
>
Did you try to profile using calloc in qemu_mallocz instead of malloc + memset ?
$ man calloc
calloc() allocates memory for an array of nmemb elements of size
bytes each and returns a pointer to the allocated memory. __The
memory is set to zero.__
--
Corentin Chary
http://xf.iksaif.net
Re: [Qemu-devel] [PATCH] virtio-blk: Avoid zeroing every request structure,
Corentin Chary <=
- Re: [Qemu-devel] [PATCH] virtio-blk: Avoid zeroing every request structure, Stefan Hajnoczi, 2010/05/18
- Re: [Qemu-devel] [PATCH] virtio-blk: Avoid zeroing every request structure, Corentin Chary, 2010/05/18
- Re: [Qemu-devel] [PATCH] virtio-blk: Avoid zeroing every request structure, Stefan Hajnoczi, 2010/05/18
- Re: [Qemu-devel] [PATCH] virtio-blk: Avoid zeroing every request structure, Stefan Hajnoczi, 2010/05/21
- [Qemu-devel] [PATCH 0/2] Tidy qemu_malloc, Richard Henderson, 2010/05/21
- Re: [Qemu-devel] [PATCH 0/2] Tidy qemu_malloc, Aurelien Jarno, 2010/05/28
- [Qemu-devel] [PATCH 2/2] linux-user: Use qemu-malloc.c., Richard Henderson, 2010/05/21
- [Qemu-devel] [PATCH 1/2] Use calloc in qemu_mallocz., Richard Henderson, 2010/05/21