Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1950836imm; Thu, 12 Jul 2018 10:27:21 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeJhRlUvJ2ThLPtTozpG5qfsd/2Dj0dIeUK+YlfbZQjUWLODyFbKYm+fKe7M0znE5CNlufB X-Received: by 2002:a63:6ac6:: with SMTP id f189-v6mr2878558pgc.170.1531416441684; Thu, 12 Jul 2018 10:27:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531416441; cv=none; d=google.com; s=arc-20160816; b=OEXiaPz6t4HSulosYP4y9hU57WWzabpwGC5bQUwOLbgm5QkbMQFM7h01/sTUAvdYUo iZeeMPhtys4AzshfYhbRxwACwrKAGyqFMdfvVD6+j0mtbwdXni4Dnnb8ConNTtFDnbt3 DZgB2QpWP/qUpZK1BQ1pbY0PXuYr7eC/Xg5HpT7nMFABu8LQK409x2DGBik0UTQQpSko BIruWyd69X2X6hDfVvx4/U6Hv2qWLV+f1lC/fWKoi8B+/klXQFOYVGpyOHpWtpr25JmM mak2IrBi5KET453oAOh+FwIJDvwfKo77DAjBOjZgPhuk871m0FHSdYhC77dZP9ycoqJW D4Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date:arc-authentication-results; bh=QDW40LjHfRs1hIW0uTQ3TqC4BY2uL/aNrMGXH5IXH1I=; b=pCUxvoVsteXNQPvgKiBERIFDyAnmK4jOJR1HlEzw6EB/W/l0PkWWTEaeoPKMggdn3C E14Kc7Bnb51bjj0visW8zg5I/o5ak0Nfhev6mHC7HwDuAoKlsr0Y1LKqSf+DOeclEQr9 TYlzKJil1TYm1x9dKvDJ6HKCrbsbP6tUfhumTuvoTN6zEw2LxHj2BFrR6WIUPZV09o5T Onq4Tjc4Aj/0KMkanIjmAHQavIrXeBKCSSQqSlKjHO8pYFDc9niwDUXDnEK2iV68NcUV P6FreZOwQ/+UiI8tTWgKK6AVk/U4hbJFf19Mr2Qq4xJSU+R7k9e4bRlEzfGvTwNccc72 F0OA== 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 g1-v6si7385451pli.58.2018.07.12.10.27.06; Thu, 12 Jul 2018 10:27:21 -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 S1732497AbeGLRgz (ORCPT + 99 others); Thu, 12 Jul 2018 13:36:55 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:33560 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726596AbeGLRgz (ORCPT ); Thu, 12 Jul 2018 13:36:55 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6CHOHVw050790 for ; Thu, 12 Jul 2018 13:26:24 -0400 Received: from e11.ny.us.ibm.com (e11.ny.us.ibm.com [129.33.205.201]) by mx0b-001b2d01.pphosted.com with ESMTP id 2k69psma1b-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 12 Jul 2018 13:26:23 -0400 Received: from localhost by e11.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 12 Jul 2018 13:26:22 -0400 Received: from b01cxnp22036.gho.pok.ibm.com (9.57.198.26) by e11.ny.us.ibm.com (146.89.104.198) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 12 Jul 2018 13:26:19 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w6CHQIsL7340498 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 12 Jul 2018 17:26:18 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 60FEAB2065; Thu, 12 Jul 2018 13:26:16 -0400 (EDT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 41572B205F; Thu, 12 Jul 2018 13:26:16 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.159]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 12 Jul 2018 13:26:16 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id C0A2516C2E9F; Thu, 12 Jul 2018 10:28:38 -0700 (PDT) Date: Thu, 12 Jul 2018 10:28:38 -0700 From: "Paul E. McKenney" To: Alan Stern Cc: Peter Zijlstra , Andrea Parri , Will Deacon , LKMM Maintainers -- Akira Yokosawa , Boqun Feng , Daniel Lustig , David Howells , Jade Alglave , Luc Maranget , Nicholas Piggin , Kernel development list , Linus Torvalds Subject: Re: [PATCH v2] tools/memory-model: Add extra ordering for locks and remove it for ordinary release/acquire Reply-To: paulmck@linux.vnet.ibm.com References: <20180712134821.GT2494@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.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18071217-2213-0000-0000-000002C9D837 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009358; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01060354; UDB=6.00544280; IPR=6.00838272; MB=3.00022118; MTD=3.00000008; XFM=3.00000015; UTC=2018-07-12 17:26:22 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18071217-2214-0000-0000-00005ACF6711 Message-Id: <20180712172838.GU3593@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-12_07:,, 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=897 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807120184 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 12, 2018 at 01:04:27PM -0400, Alan Stern wrote: > On Thu, 12 Jul 2018, Peter Zijlstra wrote: > > > > But again, these are stuble patterns, and my guess is that several/ > > > most kernel developers really won't care about such guarantees (and > > > if some will do, they'll have the tools to figure out what they can > > > actually rely on ...) > > > > Yes it is subtle, yes most people won't care, however the problem is > > that it is subtly the wrong way around. People expect causality, this is > > a human failing perhaps, but that's how it is. > > > > And I strongly feel we should have our locks be such that they don't > > subtly break things. > > > > Take for instance the pattern where RCU relies on RCsc locks, this is an > > entirely simple and straight forward use of locks, yet completely fails > > on this subtle point. > > Do you happen to remember exactly where in the kernel source this > occurs? Look for the uses of raw_spin_lock_irq_rcu_node() and friends in kernel/rcu and include/linux/*rcu*, along with the explanation in Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.html I must confess that I am not following exactly what Peter is calling out as the failure. My best guess is that he is leading up to his call for RCsc locks, but I might have missed a turn. But Peter did supply raw_spin_lock_irq_rcu_node(), which is a marked improvement over the earlier open-coding of smp_mb__after_unlock_lock() after each and every acquisition of the rcu_node structure's ->lock, so overall I cannot complain. ;-) Thanx, Paul