From mboxrd@z Thu Jan 1 00:00:00 1970 From: Waiman Long Subject: Re: [PATCH RFC v5 7/8] pvqspinlock, x86: Add qspinlock para-virtualization support Date: Thu, 27 Feb 2014 15:50:37 -0500 Message-ID: <530FA51D.6060303@hp.com> References: <1393427668-60228-1-git-send-email-Waiman.Long@hp.com> <1393427668-60228-8-git-send-email-Waiman.Long@hp.com> <530F2B8F.1010401@citrix.com> <530F3967.6030805@redhat.com> <530F4949.4050706@citrix.com> <530F4F98.2080308@redhat.com> <530F5851.1090809@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <530F5851.1090809@linux.vnet.ibm.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Raghavendra K T Cc: Jeremy Fitzhardinge , Peter Zijlstra , virtualization@lists.linux-foundation.org, Andi Kleen , "H. Peter Anvin" , Michel Lespinasse , Alok Kataria , linux-arch@vger.kernel.org, x86@kernel.org, Ingo Molnar , Scott J Norton , xen-devel@lists.xenproject.org, "Paul E. McKenney" , Alexander Fyodorov , Rik van Riel , Arnd Bergmann , Konrad Rzeszutek Wilk , Daniel J Blueman , Oleg Nesterov , Steven Rostedt , Chris Wright , George Spelvin , Thomas Gleixner , Aswin Chandramouleeswaran , Chegu List-Id: linux-arch.vger.kernel.org On 02/27/2014 10:22 AM, Raghavendra K T wrote: > On 02/27/2014 08:15 PM, Paolo Bonzini wrote: > [...] >>> But neither of the VCPUs being kicked here are halted -- they're either >>> running or runnable (descheduled by the hypervisor). >> >> /me actually looks at Waiman's code... >> >> Right, this is really different from pvticketlocks, where the *unlock* >> primitive wakes up a sleeping VCPU. It is more similar to PLE >> (pause-loop exiting). > > Adding to the discussion, I see there are two possibilities here, > considering that in undercommit cases we should not exceed > HEAD_SPIN_THRESHOLD, > > 1. the looping vcpu in pv_head_spin_check() should do halt() > considering that we have done enough spinning (more than typical > lock-hold time), and hence we are in potential overcommit. > > 2. multiplex kick_cpu to do directed yield in qspinlock case. > But this may result in some ping ponging? > > > In the current code, the lock holder can't easily locate the CPU # of the queue head when in the unlock path. That is why I try to keep the queue head alive as long as possible so that it can take over when the lock is free. I am trying out new code to let the CPUs that are waiting other than the first 2 to go to halt to see if that will help the overcommit case. -Longman