Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3550589ybi; Mon, 29 Jul 2019 08:26:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqznjb1i3SPrq11qSKVaMCZ2TE54/rR67Hlq5NZHzUA9mmfANq1SuYoT1zoNlBGAEa+xE/RS X-Received: by 2002:a17:90a:2343:: with SMTP id f61mr114182408pje.130.1564414008297; Mon, 29 Jul 2019 08:26:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564414008; cv=none; d=google.com; s=arc-20160816; b=aJAL9JtpIwQXXYUys9Ig8EDp5As/6wr66Y7bB7ZAPwdeOPhZXNyVGtspFdKxm6798h IOL22CgPU0lxoMborNp3l6Y988fEh+NYoPt+vy1U/zlOLnoYnf2skyTjWy0ouTajdUxC 1Z53Rpj6rgFORIcYleGHXuJCiP6JCCbWIfajvU/9LXmzLFMcTXlL5jqFXGOGJEmgB7NA 3Ucdu3z1FOSI90JbUoitiaTjurL+iZWDpNwQMMBnnACdUs5U9r/Atn5HVTsqusEfpMiH PUbaLenfc+JJ59eqkuDo5UaogP886ye6gS7dyQHdpqYJHqT6Y4jpFFyX0ZuUyby+sh+w WFVg== 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=FZx89eZZ1cBDWZtSjJDEcEp5nFP6/pPHiWDDeTBCfTQ=; b=Nw6dds6N0vkXUzFOjYhZ0kSObCtzpZ+Z5rc7Sq5RMxubhgc7YOhKuBanRFyeUYs1dR jeffki1jtOSFlYpq8WfoiUHwt+HiEltgysflf65OyJL0azs8GYuHOoIl9+dHFxaz+Wfc NBQQnlf2Jxe+ankLho84roNcatU1myK07CTxPtSXIVE7YzB5eHz+kIlteGMM0099A85G 6jqWupzLVBVaXzjOobrFIQRRtUZL+lqZTCQ3vFLuTjhK2SmI/QR9HAuikTNgoLYbe//P cpHe+x2JwnE+vczdXN17dm0NllWUopBv0S6veU9O33aOkakeoPfUJI9nFK5vFp7U/8bA jiuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=NEamSqOt; 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 a59si26895280plc.319.2019.07.29.08.26.32; Mon, 29 Jul 2019 08:26:48 -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=NEamSqOt; 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 S2388019AbfG2PYm (ORCPT + 99 others); Mon, 29 Jul 2019 11:24:42 -0400 Received: from merlin.infradead.org ([205.233.59.134]:47632 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387693AbfG2PYl (ORCPT ); Mon, 29 Jul 2019 11:24:41 -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=FZx89eZZ1cBDWZtSjJDEcEp5nFP6/pPHiWDDeTBCfTQ=; b=NEamSqOt48WRoVpCxOh3/8dAG WK6u8E+U0XGi+29bUCas9/PJV88ERYN99TwdcLcCpKfjLzLqrDM8FdSx/dTIlB2Ing2wOMyoLFjWn O6mAt5DIepAlznjW+8hEOqoiEaeK6PhXdb2HCHz4pfVSTEs6FMylJTYdzxnkV/Sukg+Av5Qro6FYq o0id/pAs8wRem/+ipiqiWLAjB+dw/52cXSb22+/uY53njU52OY/4QW3Ioe02/p1UWOpaOu1Ya/XfG 50sBtZKx+vHul9PmG3i6d9GVwwgmX9Jeskujp+zNWUanH30zVG23FpIT4fovM+0+D2nOZ+HlrSlUw GMs4YIWkw==; 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.92 #3 (Red Hat Linux)) id 1hs7Vl-0003Ua-SO; Mon, 29 Jul 2019 15:24:30 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A15AB20B00021; Mon, 29 Jul 2019 17:24:28 +0200 (CEST) Date: Mon, 29 Jul 2019 17:24:28 +0200 From: Peter Zijlstra To: Andrea Parri Cc: Will Deacon , linux-kernel@vger.kernel.org, Jan Stancek , Waiman Long , dbueso@suse.de, mingo@redhat.com, jade.alglave@arm.com, paulmck@linux.vnet.ibm.com Subject: Re: [PATCH 1/4] locking/rwsem: Add missing ACQUIRE to read_slowpath exit when queue is empty Message-ID: <20190729152428.GH31398@hirez.programming.kicks-ass.net> References: <20190718134954.496297975@infradead.org> <20190718135205.916241783@infradead.org> <20190719084956.GA6750@andrea> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190719084956.GA6750@andrea> 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 Fri, Jul 19, 2019 at 10:49:56AM +0200, Andrea Parri wrote: > > @@ -1032,6 +1032,8 @@ rwsem_down_read_slowpath(struct rw_semap > > */ > > if (adjustment && !(atomic_long_read(&sem->count) & > > (RWSEM_WRITER_MASK | RWSEM_FLAG_HANDOFF))) { > > + /* Provide lock ACQUIRE */ > > + smp_acquire__after_ctrl_dep(); > > Does this also make the lock RCtso? Or maybe RCtso was already > guaranteed (and I'm failing to see why)? I didn't specifically look for that, but I suspect not, esp given the next patch.