Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753806Ab3DVXI3 (ORCPT ); Mon, 22 Apr 2013 19:08:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42960 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752674Ab3DVXI1 (ORCPT ); Mon, 22 Apr 2013 19:08:27 -0400 Message-ID: <5175C2D6.9020202@redhat.com> Date: Mon, 22 Apr 2013 19:08:06 -0400 From: Rik van Riel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130402 Thunderbird/17.0.5 MIME-Version: 1.0 To: Peter Zijlstra CC: Jiannan Ouyang , LKML , Raghavendra K T , Avi Kivity , Gleb Natapov , Ingo Molnar , Marcelo Tosatti , Srikar , "H. Peter Anvin" , "Nikunj A. Dadhania" , KVM , Thomas Gleixner , Chegu Vinod , "Andrew M. Theurer" , Srivatsa Vaddagiri , Andrew Jones , Karen Noel Subject: Re: Preemptable Ticket Spinlock References: <51745650.9050204@redhat.com> <1366631460.4443.3.camel@laptop> <51753289.70406@redhat.com> <1366660147.6454.6.camel@laptop> <517595FA.800@redhat.com> <1366661294.6454.18.camel@laptop> <1366664138.8337.18.camel@laptop> In-Reply-To: <1366664138.8337.18.camel@laptop> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1348 Lines: 33 On 04/22/2013 04:55 PM, Peter Zijlstra wrote: > On Mon, 2013-04-22 at 16:46 -0400, Jiannan Ouyang wrote: >> - pv-preemptable-lock has much less performance variance compare to >> pv_lock, because it adapts to preemption within VM, >> other than using rescheduling that increase VM interference > > I would say it has a _much_ worse worst case (and thus worse variance) > than the paravirt ticket implementation from Jeremy. While full > paravirt ticket lock results in vcpu scheduling it does maintain > fairness. > > If you drop strict fairness you can end up in unbounded starvation > cases and those are very ugly indeed. If needed, Jiannan's scheme could easily be bounded to prevent infinite starvation. For example, we could allow only the first 8 CPUs in line to jump the queue. However, given the way that virtual CPUs get scheduled in and out all the time, I suspect starvation is not a worry, and we will not need the additional complexity to deal with it. You may want to play around with virtualization a bit, to get a feel for how things work in virt land. -- All rights reversed -- 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/