Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4533271ybl; Tue, 20 Aug 2019 13:31:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqxAnsVJWPiw5oH0iZiJWlDX48qcoF9zv/qJCclPZKQsOAZQe/SLsxhXXXo2HKZSmmXOU4HW X-Received: by 2002:a63:f857:: with SMTP id v23mr26149087pgj.228.1566333104603; Tue, 20 Aug 2019 13:31:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566333104; cv=none; d=google.com; s=arc-20160816; b=XulmzA6Xrq9n8DajrQLtRzJItHohRlc5arVtwAFbJvlLMSpsTPet4Or98n7rXK1Yrt fvDlq+qvAuG0NZtTGkKgP1AEKGub2DpRo95MB26rcveDWbk0b59f1qdDAEzBfy0VP1zR NEUT6037ULzRIZIRFyg5rSDBHY/Ht9+LXJhTWxigUim3unErNPMNDiBLmXMMmzfYHo/z hZJ/O1l5doR6ZuJPZdnw/Eit4Yv/P5zLKPtINAk5TRB0FZfkblvCuW0bEms5OF5cVWPB i1UNM3vUJr/ji3Ycy7qUD1r2VxB+lkHJeydNQAuv+cc0myRLqSWIjMcJ1DzVBFgu2wiz fnxg== 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:reply-to:message-id :subject:cc:to:from:date; bh=VUXFsQi2v9l0b4SENFJlkBNTXihWNBKbvvfcvYFZmzE=; b=MBmAcz+XKDd/+x0DHkTqC7t1HOx3vBm9X1YCndwLUoWOanm7eRrks6HuuqUaSj3MbA u9UkbwDPF7OGQvEXY7BwCUTjNXvYDFI2fg2mvysWU5+LckZYCCQE1vI1QuU3Zf0Ye71J 6lMGCjvDxPDtkQRNHDFB1Om/pkpjKQQKfwpAh8YEaj0CLepAx7fsevq0mxXGrwuq5PZ4 iCuzh3+K6hu73XqVLcISMrRrM7St9y8Y82d4o4a+yEvHnd+guOgcHSySL40mAFGXVQVP Se4sW8PkAilVaVsu/+KcJO1w8CKQVB3s9Z1Sh0paN1yBAm+EkaWE8vTQj+D/zyPQydVE DFGw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w8si13897870pfn.190.2019.08.20.13.31.29; Tue, 20 Aug 2019 13:31:44 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730853AbfHTUa0 (ORCPT + 99 others); Tue, 20 Aug 2019 16:30:26 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:58536 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730466AbfHTUaZ (ORCPT ); Tue, 20 Aug 2019 16:30:25 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7KKR6t2098611; Tue, 20 Aug 2019 16:29:34 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ugnvcwd6j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 Aug 2019 16:29:34 -0400 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x7KKTX67104836; Tue, 20 Aug 2019 16:29:33 -0400 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ugnvcwd60-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 Aug 2019 16:29:33 -0400 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x7KKRF1J011925; Tue, 20 Aug 2019 20:29:32 GMT Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by ppma02dal.us.ibm.com with ESMTP id 2ue976a68h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 Aug 2019 20:29:32 +0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x7KKTVLX50790690 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 20 Aug 2019 20:29:31 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B6414B2064; Tue, 20 Aug 2019 20:29:31 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 97EA3B205F; Tue, 20 Aug 2019 20:29:31 +0000 (GMT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.154]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 20 Aug 2019 20:29:31 +0000 (GMT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id C641A16C388E; Tue, 20 Aug 2019 13:29:32 -0700 (PDT) Date: Tue, 20 Aug 2019 13:29:32 -0700 From: "Paul E. McKenney" To: Peter Zijlstra Cc: Linus Torvalds , Mathieu Desnoyers , Thomas Gleixner , Joel Fernandes , Alan Stern , rostedt , Valentin Schneider , linux-kernel , Boqun Feng , Will Deacon , David Howells Subject: Re: [PATCH 1/1] Fix: trace sched switch start/stop racy updates Message-ID: <20190820202932.GW28441@linux.ibm.com> Reply-To: paulmck@linux.ibm.com References: <241506096.21688.1565977319832.JavaMail.zimbra@efficios.com> <1642847744.23403.1566005809759.JavaMail.zimbra@efficios.com> <20190820135612.GS2332@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190820135612.GS2332@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-08-20_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=956 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908200183 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 20, 2019 at 03:56:12PM +0200, Peter Zijlstra wrote: > On Sat, Aug 17, 2019 at 01:08:02AM -0700, Linus Torvalds wrote: > > > The data tearing issue is almost a non-issue. We're not going to add > > WRITE_ONCE() to these kinds of places for no good reason. > > Paulmck actually has an example of that somewhere; ISTR that particular > case actually got fixed by GCC, but I'd really _love_ for some compiler > people (both GCC and LLVM) to state that their respective compilers will > not do load/store tearing for machine word sized load/stores. I do very much recall such an example, but I am now unable to either find it or reproduce it. :-/ If I cannot turn it up in a few days, I will ask the LWN editors to make appropriate changes to the "Who is afraid" article. > Without this written guarantee (which supposedly was in older GCC > manuals but has since gone missing), I'm loathe to rely on it. > > Yes, it is very rare, but it is a massive royal pain to debug if/when it > does do happen. But from what I can see, Linus is OK with use of WRITE_ONCE() for data races on any variable for which there is at least one READ_ONCE(). So we can still use WRITE_ONCE() as we would like in our own code. Yes, you or I might be hit by someone else's omission of WRITE_ONCE(), it is better than the proverbial kick in the teeth. Of course, if anyone knows of a compiler/architecture combination that really does tear stores of 32-bit constants, please do not keep it a secret! After all, it would be good to get that addressed easily starting now rather than after a difficult and painful series of debugging sessions. Thanx, Paul