From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50966) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSkY7-0007kR-97 for qemu-devel@nongnu.org; Wed, 26 Mar 2014 05:55:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WSkY0-0005LZ-NE for qemu-devel@nongnu.org; Wed, 26 Mar 2014 05:55:07 -0400 Received: from g2t2352.austin.hp.com ([15.217.128.51]:30500) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSkY0-0005Kv-JU for qemu-devel@nongnu.org; Wed, 26 Mar 2014 05:55:00 -0400 Message-ID: <5332A3C9.80406@hp.com> Date: Wed, 26 Mar 2014 17:54:17 +0800 From: "Li, ZhenHua" MIME-Version: 1.0 References: <1395737088-13481-1-git-send-email-zhen-hual@hp.com> <20140326092718.GA20378@stefanha-thinkpad.muc.redhat.com> In-Reply-To: <20140326092718.GA20378@stefanha-thinkpad.muc.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/1] virtio-blk: Use a req pool instead of malloc/free List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org Stefan, Thank you for your suggestions. I will try g_slice_* and give more performance testing results. ZhenHua On 03/26/2014 05:27 PM, Stefan Hajnoczi wrote: > On Tue, Mar 25, 2014 at 04:44:48PM +0800, Li, Zhen-Hua wrote: >> From: "Li, ZhenHua" >> >> In virtio-blk module, when there is new request, new req structure >> will be created by malloc. Use a req pool instead of this, will increase >> performance; >> >> Increacement: about 5% to 10%. >> >> Signed-off-by: Li, ZhenHua >> --- >> hw/block/virtio-blk.c | 87 ++++++++++++++++++++++++++++++++++++++++++------- >> 1 file changed, 75 insertions(+), 12 deletions(-) > > Please try g_slice_new() instead of implementing a request pool > manually: > https://developer.gnome.org/glib/unstable/glib-Memory-Slices.html > > We already use g_slice_new() in other places in QEMU - for example in > the virtio-blk dataplane code. > > Also please provide more details about the benchmark you are running. > Which benchmark, what workload/settings, 5-10% increase of which number > (IOPS, BW/CPU%, or something else), etc. > > Stefan >