From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEdtF-0005Yq-AF for qemu-devel@nongnu.org; Tue, 05 Aug 2014 08:30:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEdtA-0006QJ-S9 for qemu-devel@nongnu.org; Tue, 05 Aug 2014 08:30:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23682) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEdtA-0006Q9-KE for qemu-devel@nongnu.org; Tue, 05 Aug 2014 08:30:48 -0400 Message-ID: <53E0CE72.2010308@redhat.com> Date: Tue, 05 Aug 2014 06:30:42 -0600 From: Eric Blake MIME-Version: 1.0 References: <1407209598-2572-1-git-send-email-ming.lei@canonical.com> <1407209598-2572-3-git-send-email-ming.lei@canonical.com> In-Reply-To: <1407209598-2572-3-git-send-email-ming.lei@canonical.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fM5O3HlUk0EK2mI8FGdM7i9sOfmSKImfw" Subject: Re: [Qemu-devel] [PATCH v1 02/17] dataplane: use object pool to speed up allocation for virtio blk request List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ming Lei , qemu-devel@nongnu.org, Peter Maydell , Paolo Bonzini , Stefan Hajnoczi Cc: Kevin Wolf , Fam Zheng , "Michael S. Tsirkin" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --fM5O3HlUk0EK2mI8FGdM7i9sOfmSKImfw Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 08/04/2014 09:33 PM, Ming Lei wrote: > g_slice_new(VirtIOBlockReq), its free pair and access the instance Took me a while to read this. Maybe: Calling g_slice_new(VirtIOBlockReq) and its free pair, and accessing the instance, are a bit slow... > is a bit slow since sizeof(VirtIOBlockReq) takes more than 40KB, > so use object pool to speed up its allocation and release. >=20 > With this patch, ~5%-10% throughput improvement is observed in the VM > based on server. >=20 > Signed-off-by: Ming Lei > --- > hw/block/dataplane/virtio-blk.c | 12 ++++++++++++ > hw/block/virtio-blk.c | 13 +++++++++++-- > include/hw/virtio/virtio-blk.h | 2 ++ > 3 files changed, 25 insertions(+), 2 deletions(-) > @@ -50,6 +52,10 @@ struct VirtIOBlockDataPlane { > Error *blocker; > void (*saved_complete_request)(struct VirtIOBlockReq *req, > unsigned char status); > + > + VirtIOBlockReq reqs[REQ_POOL_SZ]; > + void *free_reqs[REQ_POOL_SZ]; > + ObjPool req_pool; Why two instances of double spaces? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --fM5O3HlUk0EK2mI8FGdM7i9sOfmSKImfw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJT4M5yAAoJEKeha0olJ0Nqkh4H/2C464HA4vqMC+ky2NMzmlNU +523pdr8LZs+slxx3B4S0tMn68oBSsN6tdjR9E5nzKV7u38u1G/OB2LAwGe2RsTG enTH9HMmPMZmFj+jyBFWPwwOR5b34p5cKqexDu5/CeMq0HfNSpdXHkVP3KipkcQe Px9VVGAH/NAQmzYLtVlLMz8pS1o6dzyHMbh9xnG8T9A36Xuqlsn5qmFyTQGDtMFk 4WiFHwUVbf2qrdZ6gy5LTkb4/fI9eCmqa8loueuA0/KWt8ahNMQ+25zffibflThM kACjLH40kkaQM51Sas/AHZksCVfDyvdLspFgreHJggROpTd6fPW9jLmcxA8fhg4= =GL8i -----END PGP SIGNATURE----- --fM5O3HlUk0EK2mI8FGdM7i9sOfmSKImfw--