Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp834267ybx; Thu, 7 Nov 2019 03:24:22 -0800 (PST) X-Google-Smtp-Source: APXvYqwmrIOWQhilhxxEwFa5J5vZhrnPTm5yH7Dm6LKzjel+NAWV6QgIcSnj++19KEeIO76mAV29 X-Received: by 2002:a17:906:3053:: with SMTP id d19mr2481911ejd.109.1573125862833; Thu, 07 Nov 2019 03:24:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573125862; cv=none; d=google.com; s=arc-20160816; b=FZ6lLMzmX3yy4yhXWxcq4BdvVsfIoCE2ioGSimOVcQhRRsz3wzC1Udn4pNYPS6q3oZ mhsG9GbvIgEtipa3UwqgEhzuJOTArtoKkezCLtBKf4Zsx/o6/r1C4++TYV4r8KwY2uDQ mrhIsZpOXIx58q+Dww1EhN7yrGCQv+NNg0/ruKFUUY6LECixmVMQBKp/T0ZDp/aai+dC PPW9oGwAEmcYdeubDHjtcsdAnE8a3NKqIpLkEE3XYZcF9RUlRdOCQ4xMLt7KVHjxHMSW hppVvlsrjPoT0AdCLCfBh53iKFvCDd6j9W9IfS8EzXbVWKr31Mm/mFAyGXZ5B7FasUXj HWEg== 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=JINPeiHVrryTMEwvdNgTV1RtulpEsCQ4EFOvVE891WI=; b=W4QJTPAzZP5RMB92TTxyp71e9CfFb7wugUNcwnQtSo1lOGdUvy3Vfurah2+wO5pmwu ytSjLXVeoUNrurJA50RJlZ2jA5Gnd8TH2PTGEmV+hgNRnSrrFkUtGfK0NjFbVl5j2Az3 u39M4x7A5e7XnvhoYpGYJ2cOmZPxRkcqzUenywQKAB0SZxR9ogF3WAVni6GnjmNfgpVY kzHrLy0PE8ReESERSYGRRb217LKbx+qx2mzZ9mQwgYMgCOYAiVfIm8ekPOAhLbP5a4Q8 h5dY9zltoT9lA1PV5mBIJcn7+sEtIjxpMc7J+tTKd1r41E7W1N204FFMATaoAeIjhxGZ VnnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gAwmlkg+; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h19si1175576ejx.34.2019.11.07.03.23.59; Thu, 07 Nov 2019 03:24:22 -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=pass header.i=@kernel.org header.s=default header.b=gAwmlkg+; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388427AbfKGLWI (ORCPT + 99 others); Thu, 7 Nov 2019 06:22:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:34528 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388412AbfKGLWI (ORCPT ); Thu, 7 Nov 2019 06:22:08 -0500 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2353D207FA; Thu, 7 Nov 2019 11:22:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573125726; bh=+CIQPZ+/8fpJy1L09YhNePzp1OmY7Y7silMp+Oka410=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gAwmlkg+C1uqfpT4oaZ7vzWSd9xyvz0Bxo+zUKBL2Zrns5QwhTlbQvGPtAnKaSTcD 45jomg5haOVkPswa/+YSyM9Gom9rA+S7X2+q6BS43sx86egC5HVpnscjGEkBD4SNdw Ftqww3kdxYvyK0M+2MLO/SOLEGqKgMiKvELJlT0g= Date: Thu, 7 Nov 2019 11:22:01 +0000 From: Will Deacon To: Manfred Spraul Cc: LKML , Davidlohr Bueso , Waiman Long , 1vier1@web.de, Andrew Morton , Peter Zijlstra , Will Deacon Subject: Re: [PATCH 1/5] smp_mb__{before,after}_atomic(): Update Documentation Message-ID: <20191107112200.GA11587@willie-the-truck> References: <20191020123305.14715-1-manfred@colorfullife.com> <20191020123305.14715-2-manfred@colorfullife.com> <20191101164948.GD3603@willie-the-truck> <65a187c2-80de-2c6f-5f80-48c51f973d08@colorfullife.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <65a187c2-80de-2c6f-5f80-48c51f973d08@colorfullife.com> 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 Hi Manfred, On Wed, Nov 06, 2019 at 08:23:03PM +0100, Manfred Spraul wrote: > From 8d2b219794221e3ef1a1ec90e0f4fe344af9a55d Mon Sep 17 00:00:00 2001 > From: Manfred Spraul > Date: Fri, 11 Oct 2019 10:33:26 +0200 > Subject: [PATCH 1/5] smp_mb__{before,after}_atomic(): Update Documentation > > When adding the _{acquire|release|relaxed}() variants of some atomic > operations, it was forgotten to update Documentation/memory_barrier.txt: > > smp_mb__before_atomic and smp_mb__after_atomic can be combined with > all RMW operations that do not imply memory barriers. > > In order to avoid that this happens again: > Remove the paragraph from Documentation/memory_barrier.txt, the functions > are sufficiently documented in Documentation/atomic_{t,bitops}.txt > > Fixes: 654672d4ba1a ("locking/atomics: Add _{acquire|release|relaxed}() variants of some atomic operations") > > Signed-off-by: Manfred Spraul > Acked-by: Waiman Long > Cc: Davidlohr Bueso > Cc: Peter Zijlstra > Cc: Will Deacon > --- > Documentation/memory-barriers.txt | 20 +------------------- > 1 file changed, 1 insertion(+), 19 deletions(-) > > diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt > index 1adbb8a371c7..16dfb4cde1e1 100644 > --- a/Documentation/memory-barriers.txt > +++ b/Documentation/memory-barriers.txt > @@ -1873,25 +1873,7 @@ There are some more advanced barrier functions: > (*) smp_mb__before_atomic(); > (*) smp_mb__after_atomic(); > > - These are for use with atomic (such as add, subtract, increment and > - decrement) functions that don't return a value, especially when used for > - reference counting. These functions do not imply memory barriers. > - > - These are also used for atomic bitop functions that do not return a > - value (such as set_bit and clear_bit). > - > - As an example, consider a piece of code that marks an object as being dead > - and then decrements the object's reference count: > - > - obj->dead = 1; > - smp_mb__before_atomic(); > - atomic_dec(&obj->ref_count); > - > - This makes sure that the death mark on the object is perceived to be set > - *before* the reference counter is decremented. > - > - See Documentation/atomic_{t,bitops}.txt for more information. > - > + See Documentation/atomic_{t,bitops}.txt for information. > > (*) dma_wmb(); > (*) dma_rmb(); Thanks, I much prefer this approach: Acked-by: Will Deacon Will