Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7971914ybi; Thu, 6 Jun 2019 04:43:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRBmJLmhuuy7Pa27kLDX6mgN0u4VDSiYf9dGOWR4CmMrAtANZrO+Hxg3/OMVMYKjdvcSBm X-Received: by 2002:a63:d70b:: with SMTP id d11mr3011276pgg.178.1559821421780; Thu, 06 Jun 2019 04:43:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559821421; cv=none; d=google.com; s=arc-20160816; b=1ET3vEUqqsntZK5DqSeXfSVFunUL6vH0SJdE5PkGzMR7EiOZ2bQA9dFGYseSq7sCpC D4MKYjiCT/QujNnChEUiSE4ae2pCb7m4K6CrDg2HYKNF9Ld5Z2RJxKgW8+aaSvFgRkts i0VedXV1k50MozKbO0+rRGKJfi8r3nVzpeTj7JdDbxAdUZvv31ivdLW50nWu8pTT5kPv Xdz17ATSH1P2wXpPpCqUldalgvW2tX6qH3Gbas6sBUiVdyW9HQ+RXcfI7EinKjHx6yXH Roj4L3lAz5N7hKk2TxUZOXHTMvIsRjwzQj3LlxrwEXNCb3dd9k0w8fM1dooIlm+VJ8nP s6ZQ== 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=THwh6PEFB0S8Bkrg5GfNlp+3ZmR5izUnobK9xrlz/xk=; b=A19Wdhobi0ev8cdrZn1fQ2zHCXjJmAvXgvP2K9hRxvxPdp9dwBvYz+SBGh7DLOedm6 ko6yjz2xH5IcLkmziQCRpIrLvxY6bfMWZ/YeA9BWlM5cef9d0/hI+iZj4ygnLlSzdIpz h6rDPv3VSYaMpHI3f3CieNIXkb9Z8KoJKg2HSXG3IGBXjJ03z6GLAEekMAaXtKvSGNlG r4Q+M+BjHdWA6uqBThGueSEuEy2vcTtgP9ngMB7rbdq2qPi4qe24Vh+yilZLxUyibPSz uoJ/ScirSJtHePH20XMnrLpPGhRalKsQHF6YnLxqxnJ1ll1RS2fZ5quGJcqL63dqfdvP sIHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=VlocscIl; 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 129si1834663pfe.140.2019.06.06.04.43.25; Thu, 06 Jun 2019 04:43:41 -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=@amarulasolutions.com header.s=google header.b=VlocscIl; 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 S1727388AbfFFIo3 (ORCPT + 99 others); Thu, 6 Jun 2019 04:44:29 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:38206 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727182AbfFFIo2 (ORCPT ); Thu, 6 Jun 2019 04:44:28 -0400 Received: by mail-wr1-f67.google.com with SMTP id d18so1482903wrs.5 for ; Thu, 06 Jun 2019 01:44:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=THwh6PEFB0S8Bkrg5GfNlp+3ZmR5izUnobK9xrlz/xk=; b=VlocscIlXrXwXXtxerX9ivwj6pk4yDu67JX91ydwnNcYn7miZhFGFsXyV0K8UKur0V XOqQTS/jcKTiOUA0ZPXkLBRojLu/eHVzve0KE/h7mWRce83xjng2XUreMGB5FmvbKBQv zXKU/P2HhuXZ/lrsR2sDBaK4Ob6D6poOJfk6k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=THwh6PEFB0S8Bkrg5GfNlp+3ZmR5izUnobK9xrlz/xk=; b=KAlcRrlzxdVc47GNwEutQsyyUfcSUhixh7ks16zhT7gTfm1nNZE/bheT5pfHfZFFCR lJA8Dxb+lmXsnvfUL/Ki10nKtXNdPF+ZmFCHwWCgur5OePkIyqxU7mFAnq2QQWT7k7XH 9rgot3TRsAhvsoL1hVA6rXCPBsQkP1C008oD5cQHGHDs8hQIMRd6XRzwcuh+Lseq8TuN yVfr3z+qVB5ykwEC2Z04fEVJ5oS+LhWRj3vYaDisaQF9fGCpU35YYqQdtOu0yVCUy4hi cGz+LUqG+jyo4jxEleaKjRMNKjRzPePThxLlUB4Lwx+BzWab9bzn8R5imoTR8GbBb5HQ PZeQ== X-Gm-Message-State: APjAAAU/Uo+7EA3PXrkIN+MQr9zvCZOSmYRkxv3AaFmoJF/2OzIo5gfH WLcJkq0tB3tPV1Kcr6qr5E4zLVUGxbqXyg== X-Received: by 2002:a5d:618d:: with SMTP id j13mr6377313wru.195.1559810667227; Thu, 06 Jun 2019 01:44:27 -0700 (PDT) Received: from andrea (86.100.broadband17.iol.cz. [109.80.100.86]) by smtp.gmail.com with ESMTPSA id q9sm1281432wmq.9.2019.06.06.01.44.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Jun 2019 01:44:26 -0700 (PDT) Date: Thu, 6 Jun 2019 10:44:21 +0200 From: Andrea Parri 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 Cc: linux-tip-commits@vger.kernel.org Subject: Re: [tip:locking/core] Documentation/atomic_t.txt: Clarify pure non-rmw usage Message-ID: <20190606084421.GA5523@andrea> References: <20190524115231.GN2623@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.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 03, 2019 at 06:46:54AM -0700, tip-bot for Peter Zijlstra wrote: > 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 I'd appreciate if you could Cc: me in future changes to this doc. (as currently suggested by get_maintainer.pl). This is particularly annoying when you spend time to review such changes: https://lkml.kernel.org/r/20190528111558.GA9106@andrea Thanks, Andrea > --- > 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