Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp3447941pxy; Tue, 4 May 2021 02:23:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFLR0tvnZRQKGX19rOEoF/DyxwlbDozHC+fgzvaVRubkASTRtgNHFYVogJQ/SpKbJn9Q2I X-Received: by 2002:a17:90a:9f02:: with SMTP id n2mr3912892pjp.190.1620120207870; Tue, 04 May 2021 02:23:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620120207; cv=none; d=google.com; s=arc-20160816; b=OVSskobSC8+ugKQVLhZbKrwgsFvf3BCsezOxD0PCpsOuiPfbSxWv/53BO7f+S5ca+G KI6eiX6LNczNzhKVWDVQt0I9TcTL0SS3NgG8TrTTsct5o/skvSymZw3jTNQ5+iURcVaQ N307gLcllTtnORu2AU1D25bs8jtCue2jc1je4LVH/MIU7pm0sLTPqryNwwuLwfBG0MD5 FyhglwP64USwNk/23f9ruywWdyAWKdhC+uDCTQshGF2WdAodvsh0QSGbW9c5lwvvD1oP IzSwgDkm8suWQaiGwYpvpcKrueJ/2QTQUbdGGLAl1gBhjRt1tzzdHNxGScyNf733677G XLiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=P3y2DFaDAO2518AHnPLoOuXHnOylXMn+Tq53Ow0ilZE=; b=uLlhLZnUnOOk8FIDlycLHKbJR+0Hs4I9u3h+z89P9xeKEn2qWOmYjlFJ47riKHXfFl 6jyC4IalJQgQIOVi2SzEmszxnOtg8BeJxG/gFd2KhWC8FdSehtFCZAJAm7p2+N9sID+E TPGwGRsTbdWMGM106NUpLY0eqRlOJgBg2oeK2xIXdPcx+MxsGFwMzIpw6kd3E70ehTZC bCIvMkOpH87he283yls3MiWYEMfBYoXjCJ11Ii3ovvlo4eHxHDeBJ6f7sWb9LmFX3H6f jTS7TFPuGq8jOSqhyjhLsejLAjdIthDLXYRxbMpT0zh4KYMl2lw3CqaMX7s1ImTKUMZg B36A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Z86u6UVj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g36si2312997pgb.208.2021.05.04.02.23.13; Tue, 04 May 2021 02:23:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Z86u6UVj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229941AbhEDJVY (ORCPT + 99 others); Tue, 4 May 2021 05:21:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229703AbhEDJVX (ORCPT ); Tue, 4 May 2021 05:21:23 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 009F0C061574 for ; Tue, 4 May 2021 02:20:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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; bh=P3y2DFaDAO2518AHnPLoOuXHnOylXMn+Tq53Ow0ilZE=; b=Z86u6UVjMJU+z8lI+a7gVTfipW zxs2IPPrLL/3oYz/rLcT+DqGqLMFUCRtwWRba9iNPTUnOjcNHC7G5Eg4klzYraioF3XZFGmvsXnyl E4uixeSwDdJ/NObm5WD0wEbowh1EspAUuOcQCVaryUFQF7gu8GOqRdZkLU+nzgLL8PS3p+/nq9Bhj oNT2NANS/5GNVV1O1zvHXL7a1XFQjOMgw2OQToMMhO5YxpPloyjKkuif5bhZ5GkerWElfutDpCHeS aYthOMeG2tk+lapZEY0aTXUro4AHK+khS3qDsYDzvGDi18CHeRGma/reHhrtcDuhXOL5l7RGrAO/X 4BYKnF1Q==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1ldrDZ-00GO1w-Ii; Tue, 04 May 2021 09:19:52 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 901363001D0; Tue, 4 May 2021 11:19:48 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 72B2820264CB3; Tue, 4 May 2021 11:19:48 +0200 (CEST) Date: Tue, 4 May 2021 11:19:48 +0200 From: Peter Zijlstra To: Will Deacon Cc: Waiman Long , Ingo Molnar , Boqun Feng , linux-kernel@vger.kernel.org, Borislav Petkov , Ali Saidi , Steve Capper Subject: Re: [PATCH] locking/qrwlock: queued_write_lock_slowpath() cleanup Message-ID: References: <20210426185017.19815-1-longman@redhat.com> <20210427075659.GA6675@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210427075659.GA6675@willie-the-truck> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 27, 2021 at 08:56:59AM +0100, Will Deacon wrote: > On Mon, Apr 26, 2021 at 02:50:17PM -0400, Waiman Long wrote: > > Make the code more readable by replacing the atomic_cmpxchg_acquire() > > by an equivalent atomic_try_cmpxchg_acquire() and change atomic_add() > > to atomic_or(). > > > > For architectures that use qrwlock, I do not find one that has an > > atomic_add() defined but not an atomic_or(). I guess it should be fine > > by changing atomic_add() to atomic_or(). > > > > Note that the previous use of atomic_add() isn't wrong as only one > > writer that is the wait_lock owner can set the waiting flag and the > > flag will be cleared later on when acquiring the write lock. > > Right, there's no functional change here. > > > Suggested-by: Linus Torvalds > > Signed-off-by: Waiman Long > Acked-by: Will Deacon Thanks!