Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752552AbbGLIXN (ORCPT ); Sun, 12 Jul 2015 04:23:13 -0400 Received: from casper.infradead.org ([85.118.1.10]:48497 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752479AbbGLIXL (ORCPT ); Sun, 12 Jul 2015 04:23:11 -0400 Date: Sun, 12 Jul 2015 10:23:07 +0200 From: Peter Zijlstra To: Waiman Long Cc: Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, Scott J Norton , Douglas Hatch Subject: Re: [PATCH 3/7] locking/pvqspinlock: Implement wait-early for overcommitted guest Message-ID: <20150712082307.GT19282@twins.programming.kicks-ass.net> References: <1436647018-49734-1-git-send-email-Waiman.Long@hp.com> <1436647018-49734-4-git-send-email-Waiman.Long@hp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1436647018-49734-4-git-send-email-Waiman.Long@hp.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1302 Lines: 25 On Sat, Jul 11, 2015 at 04:36:54PM -0400, Waiman Long wrote: > In an overcommitted guest where some vCPUs have to be halted to make > forward progress in other areas, it is highly likely that a vCPU > later in the spinlock queue will be spinning while the ones earlier in > the queue would have been halted already. The spinning in the later > vCPUs is then just a waste of precious CPU cycles because they are > not going to get the lock soon as the earlier ones have to be woken > up and take their turn to get the lock. > > This patch implements a wait-early mechanism where the vCPU will > call pv_wait() earlier if the previous vCPU is in the halted state > already. In this case, it will spin less before calling pv_wait(). On > the other hand, if the previous vCPU was running and then becomes > halted, the current vCPU will call pv_wait() immmediately in this case. > > This patch also separates the spin threshold for queue head and > queue nodes. It favors the queue head by allowing it to spin longer > before calling pv_wait(). -ENONUMBERS -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/