From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: Re: [RFC PATCH] KVM: x86: Skip request checking branches in vcpu_enter_guest() more effectively Date: Mon, 24 Sep 2012 14:59:44 +0800 Message-ID: <506004E0.4070103@linux.vnet.ibm.com> References: <20120924152447.36c71b8f.yoshikawa_takuya_b1@lab.ntt.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: avi@redhat.com, mtosatti@redhat.com, kvm@vger.kernel.org To: Takuya Yoshikawa Return-path: Received: from e28smtp02.in.ibm.com ([122.248.162.2]:49818 "EHLO e28smtp02.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752919Ab2IXG7y (ORCPT ); Mon, 24 Sep 2012 02:59:54 -0400 Received: from /spool/local by e28smtp02.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 24 Sep 2012 12:29:51 +0530 Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay02.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q8O6xlNo36372588 for ; Mon, 24 Sep 2012 12:29:47 +0530 Received: from d28av02.in.ibm.com (loopback [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q8O6xkZF008560 for ; Mon, 24 Sep 2012 16:59:46 +1000 In-Reply-To: <20120924152447.36c71b8f.yoshikawa_takuya_b1@lab.ntt.co.jp> Sender: kvm-owner@vger.kernel.org List-ID: 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); ...... } }