Received: by 10.223.164.202 with SMTP id h10csp1234696wrb; Wed, 8 Nov 2017 00:41:04 -0800 (PST) X-Google-Smtp-Source: ABhQp+QDT6jn9W0WlqP7GbLAPdF5fMVJ+2ACxm1k48iLH9k57E1ggv+3Oyimzo96f1GW1aUTMgVu X-Received: by 10.159.218.133 with SMTP id w5mr1566095plp.127.1510130464126; Wed, 08 Nov 2017 00:41:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510130464; cv=none; d=google.com; s=arc-20160816; b=AK80fDTS9E+Nyqnc3vrzQJRl0IUfm02P0iKCQKMy0W40mwjy/UUb//DaAR0dXkKwqX zzLI3Wxm9zWbPvD3vzz2D779J5TN47o6P8/1EuGuHguf3qyYd2SRsFMhAOvodU0HsKA2 TIMwVslZ+INHgNLjJMqFtnv/jtUMBdGWQXlRYydIuOr5YtrSaQFWAs7I3NsboboC6T4p 3nK0L0n6+pgpcSl8bo1e3rSnaoFDYBgrL1IXzoubxX8YnhDlruSp09dBZiJpfgE98me/ eaYsXZMC9YlRi4HOt13KzU5R6w5yDWNv6GH/0PGWnfn9oZv4TcdUv3FnEa+5LFo0urqD LhYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=UK+XDWtCi0Xq1k6qajXF72lPLTS+wUEmJX7amzHe2xA=; b=Ox5ysHvkBrWtpyyiVTZW/kULPAr8zFGyWEVPlj+mucxd5vL144FeZnhCXmfEFx1LR/ s+EeHkn0OZU6BvAl+jjVMOq28x0jfCh778eiQG0W23m3cOWlC16OJPXdBHeqgjaYiElD rZwANWIhlvIjI/4otGWZXVWQR4HhSTmPTyR2zhu6/qo7VrLeTOJWdkiyhRDLWsx2GgF0 3WQnmW5KKV8QDi7xqnMVXTYQ0DhHlSpsgVIadpK+pR7rEsRTkVNfy5mllSxCnzucL5az Hf6YhoeLlhnQkZ94V9XeZVpEir94Yno4ZlW9aOaWmCtcSptllNuhcmSf5iV3Ny/cjSV7 yzNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=Dm1CJscI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v31si3232566plg.808.2017.11.08.00.40.50; Wed, 08 Nov 2017 00:41:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=Dm1CJscI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750927AbdKHIkO (ORCPT + 91 others); Wed, 8 Nov 2017 03:40:14 -0500 Received: from smtp-fw-33001.amazon.com ([207.171.190.10]:4860 "EHLO smtp-fw-33001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750720AbdKHIkM (ORCPT ); Wed, 8 Nov 2017 03:40:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1510130413; x=1541666413; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=UK+XDWtCi0Xq1k6qajXF72lPLTS+wUEmJX7amzHe2xA=; b=Dm1CJscI6VNnboorEctSX/POpj0qGsIKtPZ79x9/paBNaSdjTj/SeafV q4kN/b8uINHAvBM93g5MiMpVu1nV6NetyzQTAbKub6IXslOmmsPQRLqCN fW7hhlOTo1pBN5XrWWDcQGHdt50whdZ7srUpeutyE4ZSVxG0p4sdMBey3 Y=; X-IronPort-AV: E=Sophos;i="5.44,363,1505779200"; d="scan'208";a="700638631" Received: from sea3-co-svc-lb6-vlan2.sea.amazon.com (HELO email-inbound-relay-2a-7c3c5f85.us-west-2.amazon.com) ([10.47.22.34]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 08 Nov 2017 08:40:11 +0000 Received: from EX13MTAUWC001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan3.pdx.amazon.com [10.236.137.198]) by email-inbound-relay-2a-7c3c5f85.us-west-2.amazon.com (8.14.7/8.14.7) with ESMTP id vA88e7tx117413 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Wed, 8 Nov 2017 08:40:08 GMT Received: from EX13D05UWC004.ant.amazon.com (10.43.162.223) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Wed, 8 Nov 2017 08:40:07 +0000 Received: from EX13MTAUEE001.ant.amazon.com (10.43.62.200) by EX13D05UWC004.ant.amazon.com (10.43.162.223) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Wed, 8 Nov 2017 08:40:07 +0000 Received: from localhost (10.28.86.64) by mail-relay.amazon.com (10.43.62.226) with Microsoft SMTP Server id 15.0.1236.3 via Frontend Transport; Wed, 8 Nov 2017 08:40:06 +0000 Date: Wed, 8 Nov 2017 00:40:05 -0800 From: Eduardo Valentin To: Waiman Long CC: Peter Zijlstra , Ingo Molnar , , Paolo Bonzini , "Juergen Gross" , Radim =?utf-8?B?S3LEjW3DocWZ?= , Boris Ostrovsky , Eduardo Valentin Subject: Re: [PATCH v2] locking/pvqspinlock: Hybrid PV queued/unfair locks Message-ID: <20171108084005.GB13350@u40b0340c692b58f6553c.ant.amazon.com> References: <1510089486-3466-1-git-send-email-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1510089486-3466-1-git-send-email-longman@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 07, 2017 at 04:18:06PM -0500, Waiman Long wrote: > Currently, all the lock waiters entering the slowpath will do one > lock stealing attempt to acquire the lock. That helps performance, > especially in VMs with over-committed vCPUs. However, the current > pvqspinlocks still don't perform as good as unfair locks in many cases. > On the other hands, unfair locks do have the problem of lock starvation > that pvqspinlocks don't have. > > This patch combines the best attributes of an unfair lock and a > pvqspinlock into a hybrid lock with 2 modes - queued mode & unfair > mode. A lock waiter goes into the unfair mode when there are waiters > in the wait queue but the pending bit isn't set. Otherwise, it will > go into the queued mode waiting in the queue for its turn. > > > Signed-off-by: Waiman Long Reviewed-by: Eduardo Valentin -- All the best, Eduardo Valentin From 1583485488412672818@xxx Wed Nov 08 08:24:00 +0000 2017 X-GM-THRID: 1583059777669873550 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread