From mboxrd@z Thu Jan 1 00:00:00 1970 From: Raghavendra K T Subject: Re: [PATCH V2 RFC 2/3] kvm: Handle yield_to failure return code for potential undercommit case Date: Wed, 31 Oct 2012 18:11:33 +0530 Message-ID: <50911C7D.5080307@linux.vnet.ibm.com> References: <20121029140621.15448.92083.sendpatchset@codeblue> <20121029140702.15448.56932.sendpatchset@codeblue> <50911BC3.6080305@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Peter Zijlstra , "H. Peter Anvin" , Marcelo Tosatti , Ingo Molnar , Rik van Riel , Srikar , "Nikunj A. Dadhania" , KVM , Jiannan Ouyang , Chegu Vinod , "Andrew M. Theurer" , LKML , Srivatsa Vaddagiri , Gleb Natapov , Andrew Jones To: Avi Kivity Return-path: Received: from e28smtp09.in.ibm.com ([122.248.162.9]:49943 "EHLO e28smtp09.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751956Ab2JaMqO (ORCPT ); Wed, 31 Oct 2012 08:46:14 -0400 Received: from /spool/local by e28smtp09.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 31 Oct 2012 18:16:11 +0530 In-Reply-To: <50911BC3.6080305@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 10/31/2012 06:08 PM, Avi Kivity wrote: > On 10/29/2012 04:07 PM, Raghavendra K T wrote: >> From: Raghavendra K T >> >> Also we do not update last boosted vcpu in failure cases. >> >> #endif >> + >> void kvm_vcpu_on_spin(struct kvm_vcpu *me) >> { >> struct kvm *kvm = me->kvm; >> @@ -1727,11 +1727,12 @@ void kvm_vcpu_on_spin(struct kvm_vcpu *me) >> continue; >> if (!kvm_vcpu_eligible_for_directed_yield(vcpu)) >> continue; >> - if (kvm_vcpu_yield_to(vcpu)) { >> + >> + yielded = kvm_vcpu_yield_to(vcpu); >> + if (yielded > 0) >> kvm->last_boosted_vcpu = i; >> - yielded = 1; >> + if (yielded) >> break; >> - } >> } > > If yielded == -ESRCH, should we not try to yield to another vcpu? > Yes. plan is to abort the iteration. since it means we are mostly undercommitted.