From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH v2] KVM: x86: avoid unnecessary bitmap allocation when memslot is clean Date: Tue, 04 May 2010 12:36:54 +0300 Message-ID: <4BDFEAB6.3090602@redhat.com> References: <20100426185657.7f68c3ad.yoshikawa.takuya@oss.ntt.co.jp> <20100428185036.5beb8a9e.yoshikawa.takuya@oss.ntt.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: mtosatti@redhat.com, kvm@vger.kernel.org To: Takuya Yoshikawa Return-path: Received: from mx1.redhat.com ([209.132.183.28]:11586 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754655Ab0EDJg6 (ORCPT ); Tue, 4 May 2010 05:36:58 -0400 In-Reply-To: <20100428185036.5beb8a9e.yoshikawa.takuya@oss.ntt.co.jp> Sender: kvm-owner@vger.kernel.org List-ID: On 04/28/2010 12:50 PM, Takuya Yoshikawa wrote: > Hi Marcelo, Avi, > > I updated the patch as follows. > > Changelog: > 1. Inserted one "r = -ENOMEM;" line following Avi's advice. > 2. Little change of explanation about performance improvements. > > I'm now testing and cleaning up my next patch series based on this, > so please apply this if this makes sense and has no problems. > > Thanks, > Takuya > > === > > 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, reducing memory allocations and copies will produce good > effects to caches too. > > Applied, thanks. -- error compiling committee.c: too many arguments to function