Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp320958yba; Thu, 18 Apr 2019 01:42:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxW+Hnnw8MF2JYJOEY9jufHcp2rXwi1wX0eBLm4iQt7S2MKcI0GzJ+xhOcrBAqYQv3sZLPs X-Received: by 2002:a17:902:d70c:: with SMTP id w12mr94915777ply.198.1555576938263; Thu, 18 Apr 2019 01:42:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555576938; cv=none; d=google.com; s=arc-20160816; b=J6kqtPthBHGYEUPkUUouZAC6V6d7I6uozuLkhzmTztd9h9hP8D8GKhpUxjlxgCB6xu 0vgXqViwIHlf13decKykgSwuGoJBhKmYF/vkoxvoHazYSaUHGOm5ebLW3G1UR1I5OUzE uvCTPsWfij3LcL1q/CldOky760+ZcHAzcxeagWmaDfoxvEACQUOOQXYeAbwXiZVs6Ha+ vYf3LxpZZBjD9oBt8BXPyz/7XV8b3zh6/n46DvFgtX0wYer02DNTVSf5G57HOjVeGytb L9QWoYeoQsnCL58kd8wvmja/NiavJpLiVLMleJlCQKG/7rh3uWba4a91bVJ/xy2So27P isuA== 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=GCH1Ie2FAiR4E7TcUxYt/w1UZeaMOIeWYYWNM0/YfYU=; b=XWgvaMQabgXczAqD/6S3HoVXAH/mKxImFeb+civr6hQutPEBJlpcr4obxpGbTfMnxv 8KgLngktvKhakPvsBz9y5BCiyvd8DQJYPDM02eDz7HQIhYtilj0y++2caT49QQ8MSM60 +k6eQ73SXS3TZ5PsXsRt+zLRO5PBmnh46uyZPKsuhvX88rtiIQ+5GyRB4UsFffE5sp3k p8mMdpe4sLej73vA8INgbSH8WnrlxgQoGG7TgeaHNVcGgNnRMDf2sVkPX0LbAvleACx0 miQmOncg4XYccFznTL3hLp+Fvr0KQWRabWmhpF6r9pb9BX1kuYj0z9yIhu2XHdGjZBRs tTYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=jueuVe51; 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 p3si1308420pgr.382.2019.04.18.01.42.03; Thu, 18 Apr 2019 01:42:18 -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=bombadil.20170209 header.b=jueuVe51; 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 S2388248AbfDRIjr (ORCPT + 99 others); Thu, 18 Apr 2019 04:39:47 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:46158 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728074AbfDRIjq (ORCPT ); Thu, 18 Apr 2019 04:39:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=GCH1Ie2FAiR4E7TcUxYt/w1UZeaMOIeWYYWNM0/YfYU=; b=jueuVe51fnF+TXNKdSIgpiotF +B/eo1pVYrOrCEpvIIUoBdjvZZJT+IBREPInUXNbZSWTr7hcZNKCrptodrIoe2cY3lMu9/lYs1h0I bVouDP8q8NhZ9gamvzH52zQQK5ViWZLlhlH274rhzd9lYGxutbOKAkeUy9lt3yBlYxci56cP19Gxv kLw5mv95ZBSSb504JoofH0/iCoy4zLYXxgCNGv17FGfzx93TUx3F7jR7iWThQYDMi7Cv1wj4xrAHH b39+mmr1Lrhy/c4VHcqj/lyZA7nItEXi6xe+r9TWRRAGjeULRZFsiWWoYVl4QjVv5zRw97cW5l2MN eDEE4J14A==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hH2a5-00047p-Dc; Thu, 18 Apr 2019 08:39:41 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C34A029B98550; Thu, 18 Apr 2019 10:39:39 +0200 (CEST) Date: Thu, 18 Apr 2019 10:39:39 +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: <20190418083939.GU12232@hirez.programming.kicks-ass.net> References: <20190413172259.2740-1-longman@redhat.com> <20190413172259.2740-9-longman@redhat.com> <20190417124101.GE4038@hirez.programming.kicks-ass.net> <20190417124759.GT14281@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Wed, Apr 17, 2019 at 02:29:02PM -0400, Waiman Long wrote: > On 04/17/2019 08:47 AM, Peter Zijlstra wrote: > >> > >> enum owner_state { > >> OWNER_NULL = 1 << 0, > >> OWNER_WRITER = 1 << 1, > >> OWNER_READER = 1 << 2, > >> OWNER_NONSPINNABLE = 1 << 3, > >> }; > >> #define OWNER_SPINNABLE (OWNER_NULL | OWNER_WRITER) > > Hmm, we should not spin on OWNER_NULL. Or at least not mixed in with the > > patch that changes the shape of all this. That should go in the RT > > thingy patch, which comes after this. > > We do spin on OWNER_NULL right now, not in rwsem_spin_on_owner() but in > the main rwsem_optimistic_spin() function. > > RT task will quit if owner is NULL. Yeah, I figured it out eventually :-)