From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757558AbdJKT3H (ORCPT ); Wed, 11 Oct 2017 15:29:07 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:37176 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752254AbdJKT3D (ORCPT ); Wed, 11 Oct 2017 15:29:03 -0400 Date: Wed, 11 Oct 2017 12:28:57 -0700 From: "Paul E. McKenney" To: Linus Torvalds Cc: Dmitry Vyukov , Peter Zijlstra , David Howells , Will Deacon , LKML , Ingo Molnar , Mark Rutland , "linux-arch@vger.kernel.org" , Jonathan Corbet , Alexander Kuleshov Subject: Re: [PATCH RFC tip/core/rcu 12/15] lib/assoc_array: Remove smp_read_barrier_depends() Reply-To: paulmck@linux.vnet.ibm.com References: <20171011155948.GE3521@linux.vnet.ibm.com> <20171011161220.zqkdhynxerrcmvdd@hirez.programming.kicks-ass.net> <20171011162412.o6lmjiag7spwabge@hirez.programming.kicks-ass.net> <20171011164748.GK3521@linux.vnet.ibm.com> <20171011165405.xd4xfa2x3dcz4e57@hirez.programming.kicks-ass.net> <20171011170631.GN3521@linux.vnet.ibm.com> <20171011171137.bb2evetsnk2qtdhc@hirez.programming.kicks-ass.net> <20171011173423.GO3521@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 17101119-0036-0000-0000-0000027A2C9E X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007879; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000236; SDB=6.00929719; UDB=6.00467958; IPR=6.00709990; BA=6.00005634; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017494; XFM=3.00000015; UTC=2017-10-11 19:29:00 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17101119-0037-0000-0000-0000420BABE1 Message-Id: <20171011192857.GR3521@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-10-11_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-1707230000 definitions=main-1710110262 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 11, 2017 at 11:56:54AM -0700, Linus Torvalds wrote: > On Wed, Oct 11, 2017 at 11:43 AM, Dmitry Vyukov wrote: > > > > A long thread and I lost track somewhat, but, yes, from KTSAN (data > > race detector) point of view we will need a way to understand when > > things are ordered due to data and control dependencies > > (i.e.effectively acquire but only wrt the dependent stuff). > > There is a logic level and physical level, it's perfectly fine if on > > physical level all these _DEP/_CTRL variants are no-op (the same as > > READ_ONCE, at least on todays archs with todays compilers). But on > > logical level they represent a well defined, meaningful thing. > > No, they do not. > > Do you believe in fairies and Santa Claus? > > Because quite frankly, the likelihood of either of those being true is > _way_ higher than the likelihood of any normal human ever getting > those things right. > > So asking a programmer to annotate whether two memory accesses have a > data dependency or a control dependency is completely inappropriate. > You won't get people understanding it to begin with, much less then > figure out subtle things like whether a control dependency is an > actual branch, or might be turned into a data dependency through > select, or whatever. > > We've had really smart people who wrote core code that couldn't get it > right, and that weren't sure if a control dependency was really > guaranteed or not. > > That is *exactly* the kinds of thing that _automation_ should handle. > Not some human. Figure the data/control dependencies out from the > code, not from some logical level. > > I saw the contortions that the ISO C people tried to go through just > to describe control and data dependencies. It was awful. It should > have never been described on that kind of level to begin with, when it > would have been much easier to just describe it to compiler people as > "this is a consume relationship". The same rules apply here. Don't > make it about some high-level thing and humans annontating things. > Make it about the actual generated code. Speaking as one of the ISO C people... What exactly do you have in mind when you say to just describe it to compiler people as "this is a consume relationship"? Thanx, Paul