Received: from eggs.gnu.org ([2001:4830:134:3::10]:41379) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSk7N-00034a-3J for qemu-devel@nongnu.org; Wed, 26 Mar 2014 05:27:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WSk7H-0001x6-Px for qemu-devel@nongnu.org; Wed, 26 Mar 2014 05:27:29 -0400 Received: from mail-wg0-x230.google.com ([2a00:1450:400c:c00::230]:52033) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSk7H-0001wM-JQ for qemu-devel@nongnu.org; Wed, 26 Mar 2014 05:27:23 -0400 Received: by mail-wg0-f48.google.com with SMTP id l18so1083491wgh.31 for ; Wed, 26 Mar 2014 02:27:22 -0700 (PDT) Date: Wed, 26 Mar 2014 10:27:18 +0100 From: Stefan Hajnoczi Message-ID: <20140326092718.GA20378@stefanha-thinkpad.muc.redhat.com> References: <1395737088-13481-1-git-send-email-zhen-hual@hp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1395737088-13481-1-git-send-email-zhen-hual@hp.com> 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: "Li, Zhen-Hua" Cc: qemu-devel@nongnu.org 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