Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753693AbdGLTNq (ORCPT ); Wed, 12 Jul 2017 15:13:46 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:56014 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753020AbdGLTNo (ORCPT ); Wed, 12 Jul 2017 15:13:44 -0400 Date: Wed, 12 Jul 2017 12:13:24 -0700 From: "Paul E. McKenney" To: Peter Zijlstra Cc: Boqun Feng , Will Deacon , linux-kernel@vger.kernel.org, Ingo Molnar , Thomas Gleixner Subject: Re: [RFC][PATCH]: documentation,atomic: Add a new atomic_t document Reply-To: paulmck@linux.vnet.ibm.com References: <20170609092450.jwmldgtli57ozxgq@hirez.programming.kicks-ass.net> <20170609154442.GB9236@arm.com> <20170609193604.ncw3hhgvewzc3h5u@hirez.programming.kicks-ass.net> <20170611135632.sl72klbeklelupej@tardis> <20170612144929.3wiwtbqopsfpm3qk@hirez.programming.kicks-ass.net> <20170712125347.xz2atyddeilhtdnd@tardis> <20170712130826.6qs4fcrwkowe4uoh@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170712130826.6qs4fcrwkowe4uoh@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 17071219-0044-0000-0000-0000036C51AF X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007356; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000214; SDB=6.00886624; UDB=6.00442592; IPR=6.00666773; BA=6.00005468; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016201; XFM=3.00000015; UTC=2017-07-12 19:13:28 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17071219-0045-0000-0000-0000079A5608 Message-Id: <20170712191324.GF2393@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-07-12_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1707120309 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1873 Lines: 44 On Wed, Jul 12, 2017 at 03:08:26PM +0200, Peter Zijlstra wrote: > On Wed, Jul 12, 2017 at 08:53:47PM +0800, Boqun Feng wrote: > > On Mon, Jun 12, 2017 at 04:49:29PM +0200, Peter Zijlstra wrote: > > [...] > > > -Any atomic operation that modifies some state in memory and returns information > > > -about the state (old or new) implies an SMP-conditional general memory barrier > > > -(smp_mb()) on each side of the actual operation (with the exception of > > > -explicit lock operations, described later). These include: > > > - > > > - xchg(); > > > - atomic_xchg(); atomic_long_xchg(); > > > - atomic_inc_return(); atomic_long_inc_return(); > > > - atomic_dec_return(); atomic_long_dec_return(); > > > - atomic_add_return(); atomic_long_add_return(); > > > - atomic_sub_return(); atomic_long_sub_return(); > > > - atomic_inc_and_test(); atomic_long_inc_and_test(); > > > - atomic_dec_and_test(); atomic_long_dec_and_test(); > > > - atomic_sub_and_test(); atomic_long_sub_and_test(); > > > - atomic_add_negative(); atomic_long_add_negative(); > > > - test_and_set_bit(); > > > - test_and_clear_bit(); > > > - test_and_change_bit(); > > > - > > > > The bit related operations are removed from memory-barriers.txt, I think > > we'd better add them in atomic_t.txt? By "them", I mean: > > > > test_and_{set,clear,change}_bit() as RMW atomic > > > > {set,clear,change}_bit() as non-RMW atomic > > > > test_and_set_bit_lock() > > clear_bit_unlock() as non-RMW(but barrier-like) atomic > > I was thinking maybe a separate file, as I was hoping to eventually > write a separate file on spinlocks too. > > I'd like to keep the the new thing purely about the atomic* family of > stuff, that's large enough as is. As long as wherever the information is kept actually gets updated when new functions are added or old ones change, I am good. Thanx, Paul