Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3019596imu; Thu, 29 Nov 2018 14:08:04 -0800 (PST) X-Google-Smtp-Source: AFSGD/VBv5YvBn6lSdtAaYyiZbsJxp6U0WUFt91WTGd1qyZ5iN9g8aNS1TiXS4e93Qx5Jy6MOKtL X-Received: by 2002:a63:e40c:: with SMTP id a12mr2758013pgi.28.1543529284082; Thu, 29 Nov 2018 14:08:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543529284; cv=none; d=google.com; s=arc-20160816; b=W9fgKmeuCb+EM1whNktRzsDJ9VPUk7tyqYYV6rcpFf6cN8r2cN0riN3LtnfbtU5LCh hT8xi1EOKrtpsZA0U9iX5/a2XlpDcniEYidqcN4kokHo9WNNoiFEFNPFGFMEBryf57JZ uY4uiyV/qaRyIy+DfMRmSwlLJ8jYntG66VNFh/v4h3oahnKVz2XIhb/brEzx6/AiETsX cb9bM9UCbsBSxCKUFZk2UxW3O3sxAdfqe10wzyVyWJklu8ONzrDbRwPfPv5K2jIBXeft mF80+OMgy1h/PMl8fnDAViCty6y7Y0Xex3289JDi8XONNMgeCsixX4jtHUnNETmUWj8O 2FmA== 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=sQcchp0v1AdgV+xp04HannO5gduWeCP2b+Ww1xRMirI=; b=I4F+3LZiwmJkZhCtsuMITdUS9PA3FhaX6hDDY0WJsrKjIinDJLiB3aocxur0NHh5Ig CmesEjvyzqlrMKuaB7szyO4ydWLdRODX02F0+sHw1tVEk2sqU3Zcj+Jyfux5Ao/nm7UQ jcA60aD8J5sNXCODRaHwgHk0tOnIRyxErYmLIZhwn63fPP/V/6HFWmvHOrK+Cl4jzJdA Nvy88YqthIp7HMkzcdL8Po1N4gvvg2kigjQSY8Oi4DFpsVGqkd3Q9rEDBbBMIXUlApFQ KOpwa90MIhy2nXb96uytTnJMml48ZS73ea1sAehQ3LwswZb707GrEAkYe19YBUe2NA50 ZrfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=Nygxx1lS; 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 g8si3092732pgb.128.2018.11.29.14.07.49; Thu, 29 Nov 2018 14:08: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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=Nygxx1lS; 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 S1726422AbeK3JM4 (ORCPT + 99 others); Fri, 30 Nov 2018 04:12:56 -0500 Received: from merlin.infradead.org ([205.233.59.134]:54590 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726264AbeK3JMz (ORCPT ); Fri, 30 Nov 2018 04:12:55 -0500 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=sQcchp0v1AdgV+xp04HannO5gduWeCP2b+Ww1xRMirI=; b=Nygxx1lSjsLaJNjNkpyw9sg6I Mnq7rhNeYIHhjx0a00imKIsE8nfG1cn3JQGenCB8cUdZlV3YPUrenw5ru7Ltrkli3jDK3K3l+efC4 lFBobCoF+JuuVDT/MgUB6AMne2zVou2wy4Fh425OwQHAXc9ixLTbFGw5NtaKj/BzwocgDbLYW1tVG +YdmRiGUgTrPSLhbovYJ/cp2+DPlWssyhZrlZdmWxakWAAGaPeEOSRCxm/2dw7t1zY4GB4jbzSGuM YE/nttJ6YivxJ3gKApzTLeHyamY2QF5b/9Wpe7jESVsAfuLB8FzkZD3Q9I/yJgXSMQYQa6g1yh6oE jWfvRaW5A==; 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 1gSURO-0005xR-5b; Thu, 29 Nov 2018 22:05:46 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C8F6D2029FD58; Thu, 29 Nov 2018 23:05:44 +0100 (CET) Date: Thu, 29 Nov 2018 23:05:44 +0100 From: Peter Zijlstra To: Waiman Long Cc: Will Deacon , Yongji Xie , mingo@redhat.com, linux-kernel@vger.kernel.org, xieyongji@baidu.com, zhangyu31@baidu.com, liuqi16@baidu.com, yuanlinsi01@baidu.com, nixun@baidu.com, lilin24@baidu.com, Davidlohr Bueso Subject: Re: [RFC] locking/rwsem: Avoid issuing wakeup before setting the reader waiter to nil Message-ID: <20181129220544.GE11632@hirez.programming.kicks-ass.net> References: <1543495830-2644-1-git-send-email-xieyongji@baidu.com> <20181129131232.GN2131@hirez.programming.kicks-ass.net> <5598cd71-c3c8-d6ef-eb30-777cf901a2ef@redhat.com> <20181129160627.GU2131@hirez.programming.kicks-ass.net> <8cc45695-b325-a219-8b46-d5da6ddfdd63@redhat.com> <20181129172700.GA11632@hirez.programming.kicks-ass.net> <20181129180828.GA11650@hirez.programming.kicks-ass.net> <729ceddb-dd9a-ec2a-f74e-03fa4d7e65e8@redhat.com> <20181129183103.GA4952@arm.com> 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 Thu, Nov 29, 2018 at 01:34:05PM -0500, Waiman Long wrote: > That will certainly work for x86. However, I am not sure if that will be > optimal for arm and powerpc. smp_mb__before_atomic() cmpxchg_relaxed() works. Also see pv_kick_node()'s commit: 34d54f3d6917 ("locking/pvqspinlock: Relax cmpxchg's to improve performance on some architectures") you might know the author of that :-)