From mboxrd@z Thu Jan 1 00:00:00 1970 From: Raghavendra K T Subject: Re: [PATCH RFC 2/2] kvm PLE handler: Choose better candidate for directed yield Date: Tue, 10 Jul 2012 17:16:24 +0530 Message-ID: <4FFC1610.5060801@linux.vnet.ibm.com> References: <20120709062012.24030.37154.sendpatchset@codeblue> <20120709062053.24030.52767.sendpatchset@codeblue> <4FFB5B81.4040903@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4FFB5B81.4040903@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Archive: List-Post: To: Rik van Riel Cc: "H. Peter Anvin" , Thomas Gleixner , Marcelo Tosatti , Ingo Molnar , Avi Kivity , S390 , Carsten Otte , Christian Borntraeger , KVM , chegu vinod , "Andrew M. Theurer" , LKML , X86 , Gleb Natapov , linux390@de.ibm.com, Srivatsa Vaddagiri , Joerg Roedel List-ID: On 07/10/2012 04:00 AM, Rik van Riel wrote: > On 07/09/2012 02:20 AM, Raghavendra K T wrote: > >> +bool kvm_arch_vcpu_check_and_update_eligible(struct kvm_vcpu *vcpu) >> +{ >> + bool eligible; >> + >> + eligible = !vcpu->arch.plo.pause_loop_exited || >> + (vcpu->arch.plo.pause_loop_exited&& >> + vcpu->arch.plo.dy_eligible); >> + >> + if (vcpu->arch.plo.pause_loop_exited) >> + vcpu->arch.plo.dy_eligible = !vcpu->arch.plo.dy_eligible; >> + >> + return eligible; >> +} > > This is a nice simple mechanism to skip CPUs that were > eligible last time and had pause loop exits recently. > > However, it could stand some documentation. Please > add a good comment explaining how and why the algorithm > works, when arch.plo.pause_loop_exited is cleared, etc... > > It would be good to make this heuristic understandable > to people who look at the code for the first time. > Thanks for the review. will do more documentation.