Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753546AbbGNUpR (ORCPT ); Tue, 14 Jul 2015 16:45:17 -0400 Received: from casper.infradead.org ([85.118.1.10]:33487 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752503AbbGNUpQ (ORCPT ); Tue, 14 Jul 2015 16:45:16 -0400 Date: Tue, 14 Jul 2015 22:45: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 6/7] locking/qspinlock: A fairer queued unfair lock Message-ID: <20150714204507.GN19282@twins.programming.kicks-ass.net> References: <1436647018-49734-1-git-send-email-Waiman.Long@hp.com> <1436647018-49734-7-git-send-email-Waiman.Long@hp.com> <20150712082105.GQ19282@twins.programming.kicks-ass.net> <55A55934.7020606@hp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55A55934.7020606@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: 1410 Lines: 25 On Tue, Jul 14, 2015 at 02:47:16PM -0400, Waiman Long wrote: > On 07/12/2015 04:21 AM, Peter Zijlstra wrote: > >On Sat, Jul 11, 2015 at 04:36:57PM -0400, Waiman Long wrote: > >>For a virtual guest with the qspinlock patch, a simple unfair byte lock > >>will be used if PV spinlock is not configured in or the hypervisor > >>isn't either KVM or Xen. > >Why do we care about this case enough to add over 300 lines of code? > > From my testing, I found the queued unfair lock to be superior to both the > byte lock or the PV qspinlock when the VM is overcommitted. My current > opinion is to use PV qspinlock for VMs that are not likely to run into the > overcommited problem. For other VMs that are overcommitted, it will be > better to use the queued unfair lock. However, this is a choice that the > system administrators have to made. That is also the reason why I sent out > another patch to add a KVM command line option to disable PV spinlock like > what Xen already has. In this way, depending on how the kernel is booted, we > can choose either PV qspinlock or queued unfair lock. No, we're not going to add another 300 line lock implementation and a knob. -- 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/