From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [RFC PATCH] KVM: x86: Skip request checking branches in vcpu_enter_guest() more effectively Date: Mon, 24 Sep 2012 12:09:00 +0200 Message-ID: <5060313C.1060506@redhat.com> References: <20120924152447.36c71b8f.yoshikawa_takuya_b1@lab.ntt.co.jp> <506004E0.4070103@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Takuya Yoshikawa , mtosatti@redhat.com, kvm@vger.kernel.org To: Xiao Guangrong Return-path: Received: from mx1.redhat.com ([209.132.183.28]:50926 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753928Ab2IXKym (ORCPT ); Mon, 24 Sep 2012 06:54:42 -0400 In-Reply-To: <506004E0.4070103@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On 09/24/2012 08:59 AM, Xiao Guangrong wrote: > On 09/24/2012 02:24 PM, Takuya Yoshikawa wrote: >> This is an RFC since I have not done any comparison with the approach >> using for_each_set_bit() which can be seen in Avi's work. >> > > Why not compare it? I think for_each_set_bit is better and it can > improve for all cases (in your patch, you did not consider all case, > for example, if the guest under mm overcommit, it should generate > lots of TLB flush/RELOAD request). > > Actually, i think Avi's way can be improved in the further, we can > just use one atomic operation to avoid cache-miss. May be like this: > > while (vcpu->request) { > xchg(vcpu->request, request); > > for_each_set_bit(request) { > clear_bit(X); > > ...... > } > > } In fact I had something like that in one of the earlier versions, but it was problematic. I'll try to see what the issue was. -- error compiling committee.c: too many arguments to function