Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4170995ybi; Mon, 3 Jun 2019 06:50:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqwHIr2ZcMux6dUbAI/Oze4vLK1XwfXymsBCHp6X/FgDjW5UGc+/LLqsDsXz8lg6qvNLFErX X-Received: by 2002:a17:90a:a008:: with SMTP id q8mr10381815pjp.114.1559569837759; Mon, 03 Jun 2019 06:50:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559569837; cv=none; d=google.com; s=arc-20160816; b=XHFE6ydiSdeoD9WTdj0ep8gMJPanCQsxce91Cu+9y7pr7hpS9341ij2RcTbXZ9NCaJ TLLXk4RpIflrY3DIDZQvMvBpkJKjKSY+hbzNSWtUAFWNW46E33RQG7rzkM0I1M4FD2H/ NsV5y/GafPGyUVUmh++x2SBF2+ND65W1tWyiWBmcvzoL5oJI2pCaI6XXBKpSVo33oWck gSBHIwpt2S2b3hpek2lkObvceBRWtZ5h6r4PnIAk+WvndqGHqpgduIacCt2KvVwELG3K gfsWcTw9HoOxPRJPdQwP3CS61ZlrkWPYa9yTya2ok/U84YhqH65oySb96Fr6VE6h6Bxj fAJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=KaxlY8gRkqYFbl8qJuKzVYECIMo+aVoMr4I+uFZNfIs=; b=GT7QGyjVVkgVomLUpRyrr8oubEl20ciIIqGzVGPg10QY3/25ORTTKGDlzwOMJo7lAg hf95nkZio8Mmj/F/kjQVOKiXXZLKnynSs0eGT0LP7YThynlVfuWXrgnjgn/izRPgYvkm 9o3uB7FJ+IcjZA2CdiwQzPD39NYXoBw+/TzQc1q6r0X2ilrw9FcperOa7TUqoJbRy3rQ w8GIIGEyK4mDoC86FBGAWpcsgs2mPLXQ5I0hS90UiYiCX0n/CeGiDte2aZgnjDkOZfNg DrH50GQN+prDo4kr4lMh+giclHvjWyB8qKR9lUwobPazP76ohiI2ckfQFVPuhW8sLCXs U2qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019051801 header.b="gYR8AN/v"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e4si17531941pjs.104.2019.06.03.06.50.19; Mon, 03 Jun 2019 06:50:37 -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=pass header.i=@zytor.com header.s=2019051801 header.b="gYR8AN/v"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728165AbfFCNrI (ORCPT + 99 others); Mon, 3 Jun 2019 09:47:08 -0400 Received: from terminus.zytor.com ([198.137.202.136]:60195 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726780AbfFCNrI (ORCPT ); Mon, 3 Jun 2019 09:47:08 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x53DksWe614413 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 3 Jun 2019 06:46:54 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x53DksWe614413 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019051801; t=1559569615; bh=KaxlY8gRkqYFbl8qJuKzVYECIMo+aVoMr4I+uFZNfIs=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=gYR8AN/vMe8byeKzHmXO/o67z9VRyx1WknTy36v7dOXviJphQNVIpYtrZkn/NWZJ4 75Js9BN/El5Vo8qam6Kn3Zj3wLO6k7Fl23VIrBStY3egX8bO3AAIoUd+qARWlJ0Lkq oOJYq1N1KkpSN2yL/Bt+nAZz34Mfr4v6y6mWzRRc9F9A0PnqlFRRRpzB3o2e+ztN0U Y3T4DPfEwPOfNQEQWjj884qWHhCzJlwBqMDLnNcaId0rKbQavS5Tw1tGRdznD9E/Js v2Bmx2Qt+x/yUUBm5KDbDZ1oSRYxEFKVqTJnFwHfT6VM50VEhAbFb2tWbgsHdcc1BS /Wk3rbD9hSyUw== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x53Dksqb614410; Mon, 3 Jun 2019 06:46:54 -0700 Date: Mon, 3 Jun 2019 06:46:54 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Peter Zijlstra Message-ID: Cc: torvalds@linux-foundation.org, mingo@kernel.org, gregkh@linuxfoundation.org, tglx@linutronix.de, hpa@zytor.com, peterz@infradead.org, linux-kernel@vger.kernel.org, will.deacon@arm.com Reply-To: torvalds@linux-foundation.org, mingo@kernel.org, gregkh@linuxfoundation.org, tglx@linutronix.de, hpa@zytor.com, peterz@infradead.org, will.deacon@arm.com, linux-kernel@vger.kernel.org In-Reply-To: <20190524115231.GN2623@hirez.programming.kicks-ass.net> References: <20190524115231.GN2623@hirez.programming.kicks-ass.net> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] Documentation/atomic_t.txt: Clarify pure non-rmw usage Git-Commit-ID: fff9b6c7d26943a8eb32b58364b7ec6b9369746a X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.4 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: fff9b6c7d26943a8eb32b58364b7ec6b9369746a Gitweb: https://git.kernel.org/tip/fff9b6c7d26943a8eb32b58364b7ec6b9369746a Author: Peter Zijlstra AuthorDate: Fri, 24 May 2019 13:52:31 +0200 Committer: Ingo Molnar CommitDate: Mon, 3 Jun 2019 12:32:57 +0200 Documentation/atomic_t.txt: Clarify pure non-rmw usage Clarify that pure non-RMW usage of atomic_t is pointless, there is nothing 'magical' about atomic_set() / atomic_read(). This is something that seems to confuse people, because I happen upon it semi-regularly. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Greg Kroah-Hartman Acked-by: Will Deacon Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lkml.kernel.org/r/20190524115231.GN2623@hirez.programming.kicks-ass.net Signed-off-by: Ingo Molnar --- Documentation/atomic_t.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Documentation/atomic_t.txt b/Documentation/atomic_t.txt index dca3fb0554db..89eae7f6b360 100644 --- a/Documentation/atomic_t.txt +++ b/Documentation/atomic_t.txt @@ -81,9 +81,11 @@ Non-RMW ops: The non-RMW ops are (typically) regular LOADs and STOREs and are canonically implemented using READ_ONCE(), WRITE_ONCE(), smp_load_acquire() and -smp_store_release() respectively. +smp_store_release() respectively. Therefore, if you find yourself only using +the Non-RMW operations of atomic_t, you do not in fact need atomic_t at all +and are doing it wrong. -The one detail to this is that atomic_set{}() should be observable to the RMW +A subtle detail of atomic_set{}() is that it should be observable to the RMW ops. That is: C atomic-set