From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753171AbbIPPHB (ORCPT ); Wed, 16 Sep 2015 11:07:01 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:49219 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751734AbbIPPHA (ORCPT ); Wed, 16 Sep 2015 11:07:00 -0400 Date: Wed, 16 Sep 2015 17:01:31 +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 , Davidlohr Bueso Subject: Re: [PATCH v6 5/6] locking/pvqspinlock: Allow 1 lock stealing attempt Message-ID: <20150916150131.GC3604@twins.programming.kicks-ass.net> References: <1441996658-62854-1-git-send-email-Waiman.Long@hpe.com> <1441996658-62854-6-git-send-email-Waiman.Long@hpe.com> <20150914140051.GT18489@twins.programming.kicks-ass.net> <55F71CC8.3050306@hpe.com> <20150915082430.GX16853@twins.programming.kicks-ass.net> <55F8394A.1010809@hpe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55F8394A.1010809@hpe.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 On Tue, Sep 15, 2015 at 11:29:14AM -0400, Waiman Long wrote: > Only the queue head vCPU will be in pv_wait_head() spinning to acquire the > lock. But what will guarantee fwd progress for the lock that is the head? Suppose CPU0 becomes head and enters the /* claim the lock */ loop. Then CPU1 comes in, steals it in pv_wait_head(). CPU1 releases, CPU1 re-acquires and _again_ steals in pv_wait_head(), etc.. All the while CPU0 doesn't go anywhere.