From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH] KVM: Don't use vcpu->requests for steal time accounting Date: Fri, 14 Dec 2012 17:41:10 +0200 Message-ID: <20121214154110.GR29003@redhat.com> References: <20121214193718.efd714cf.yoshikawa_takuya_b1@lab.ntt.co.jp> <20121214112815.GM29003@redhat.com> <20121215001208.de27019a1768bbe6b406b6dd@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Takuya Yoshikawa , mtosatti@redhat.com, kvm@vger.kernel.org To: Takuya Yoshikawa Return-path: Received: from mx1.redhat.com ([209.132.183.28]:26916 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756248Ab2LNPlT (ORCPT ); Fri, 14 Dec 2012 10:41:19 -0500 Content-Disposition: inline In-Reply-To: <20121215001208.de27019a1768bbe6b406b6dd@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On Sat, Dec 15, 2012 at 12:12:08AM +0900, Takuya Yoshikawa wrote: > On Fri, 14 Dec 2012 13:28:15 +0200 > Gleb Natapov wrote: > > > On Fri, Dec 14, 2012 at 07:37:18PM +0900, Takuya Yoshikawa wrote: > > > We can check if accum_steal has any positive value instead of using > > > KVM_REQ_STEAL_UPDATE bit in vcpu->requests; and this is the way we > > > usually do for accounting for something in the kernel. > > > > > Now you added check that will be done on each guest entry, requests > > mechanism prevents that. > > Yes, +1 "if" for the case we have nothing in requests. > Almost any bit in requests can be replaced by one "if". Those if's add up. > I'm not sure if setting and clearing a bit for that minor > optimization is worth it. > Setting/clearing it should be much more rare than guest entry. -- Gleb.