From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH 1/1] KVM: x86: avoid unnecessary bitmap allocation when memslot is clean Date: Tue, 27 Apr 2010 09:36:17 -0300 Message-ID: <20100427123617.GA18410@amt.cnet> References: <20100426185657.7f68c3ad.yoshikawa.takuya@oss.ntt.co.jp> <20100426185854.5d606a04.yoshikawa.takuya@oss.ntt.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: avi@redhat.com, kvm@vger.kernel.org To: Takuya Yoshikawa Return-path: Received: from mx1.redhat.com ([209.132.183.28]:27875 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755580Ab0D0NB6 (ORCPT ); Tue, 27 Apr 2010 09:01:58 -0400 Content-Disposition: inline In-Reply-To: <20100426185854.5d606a04.yoshikawa.takuya@oss.ntt.co.jp> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Apr 26, 2010 at 06:58:54PM +0900, Takuya Yoshikawa wrote: > Although we always allocate a new dirty bitmap in x86's get_dirty_log(), > it is only used as a zero-source of copy_to_user() and freed right after > that when memslot is clean. This patch uses clear_user() instead of doing > this unnecessary zero-source allocation. > > Performance improvement: as we can expect easily, the time needed to > allocate a bitmap is completely reduced. In my test, the improved ioctl > was about 4 to 10 times faster than the original one for clean slots. > Furthermore, the reduced allocations seem to produce good effects for > other cases too. Actually, I observed that the time for the ioctl was > more stable than the original one and the average time for dirty slots > was also reduced by some extent. > > Signed-off-by: Takuya Yoshikawa Looks good to me.