Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4041595yba; Wed, 17 Apr 2019 03:22:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqy83z3yFHs7lnHyI4wHry++lPXPucaO3lKih7eZ5mjAVt9idO4jN2OKG06JBSEsGl9x7Vbw X-Received: by 2002:a17:902:e48c:: with SMTP id cj12mr86267211plb.93.1555496536049; Wed, 17 Apr 2019 03:22:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555496536; cv=none; d=google.com; s=arc-20160816; b=g2qEsILc1N40qWCp3iMIGBX1a2Jw6JMLhkvPwXz1fGWf2HO8aGGhFwgRWGoyumcjLs CUUrJYEy97k9GT83stD/hO1bXfaXzJvlZEteUEreVPGrfzTzXihVs8IxX5r3IW1jHyiB eKY8oRLjX2fsoOg/VrTCqzRr/VtyzOQJ+NQf0p1mknniZ/9v0MhnCUr+hpHjlxalF4oj 0cbukFoPwPg/Iga4y4VogbTP4owGA4pCCQzVDmaKDPRom8yUklGDZGAM3I9/1ErZerLK e7h0cyRa6W7XGZwgA96pat5L08r5xYWyOA3XnizZVmgbj8mszHnH0W9aPouisSAv45Nm +gGA== 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; bh=PtxPNhcPSDEVq3vvBY5zgEd48XRH8i7KjKjRALWKodY=; b=Umk/8rvT3RogTl3isf/nmW9VEh48GVAQmSLW5jyhDfxxvUdI7xWuYWCk1OQy8B+fY5 KYLf7pW0BrTkpKcdUePmliOTn8j38E9V+mW2MdWmQuw9r5Wco5h8RWPm6LBOGhQdC4XL Nc+HKCt8/P63oFifE8HnxBsq82Abkk4exHWNu385KSUkZSwg7pVzRGq8UcXLguzeSHph 5lkTldcPo6PRKRuDkVJR737Ut2aB2Z6l5gLcnftJilavpNZJmTQsRsiz5wEosbT2HYuU ccrO71XUqftiUayiCwJRBxjVCO9Tnj5Os8+uJWCf5lSR4LvBLXr5OoIjFsZzqpIn/pi8 jEYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b="BVS/84be"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id az5si49072336plb.111.2019.04.17.03.22.01; Wed, 17 Apr 2019 03:22:16 -0700 (PDT) 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=fail header.i=@infradead.org header.s=merlin.20170209 header.b="BVS/84be"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731745AbfDQKTj (ORCPT + 99 others); Wed, 17 Apr 2019 06:19:39 -0400 Received: from merlin.infradead.org ([205.233.59.134]:55428 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726695AbfDQKTj (ORCPT ); Wed, 17 Apr 2019 06:19:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=PtxPNhcPSDEVq3vvBY5zgEd48XRH8i7KjKjRALWKodY=; b=BVS/84be1IE7J0Q6Y+M+/S4xw iQsZsRWvQzaKLZdOOuynb10Y0bR1guVMd1Rqs3j8hgQ2x0YPWB6C6lkIstUtjJLG0Fzlh+0cbL3El 9McolpLLOiuxJUipQzdzxNRYvyduRzyW+Wa4fQY61Qp2lZ69mTSRySoTHDKuBqdgaP6FBJAzdpAXn lSsjBM4wlBOUab/rX3cjRjmzJ5d6wzqZuxG9usezNk8WI0t2++cVpVIeuRJJROz3EK0ZtgvrHPz5m HNjDSmXBR6nbDlTODmBPjDKTDPeF8sWMdwavtJmhSI8qdRE5vOgxQ+SkRmbEtbfZ+CdZwF9Iu0PPZ let3TKMag==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGhek-00080P-4c; Wed, 17 Apr 2019 10:19:07 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 9592529B53433; Wed, 17 Apr 2019 12:19:03 +0200 (CEST) Date: Wed, 17 Apr 2019 12:19:03 +0200 From: Peter Zijlstra To: Waiman Long Cc: Ingo Molnar , Will Deacon , Thomas Gleixner , linux-kernel@vger.kernel.org, x86@kernel.org, Davidlohr Bueso , Linus Torvalds , Tim Chen , huang ying Subject: Re: [PATCH v4 08/16] locking/rwsem: Make rwsem_spin_on_owner() return owner state Message-ID: <20190417101903.GD4038@hirez.programming.kicks-ass.net> References: <20190413172259.2740-1-longman@redhat.com> <20190413172259.2740-9-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190413172259.2740-9-longman@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 13, 2019 at 01:22:51PM -0400, Waiman Long wrote: > In the special case that there is no active lock and the handoff bit > is set, optimistic spinning has to be stopped. This makes me think this should've been _before_ you added the handoff bit. So that when you introduce the handoff, everything is solid.