Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp318282yba; Wed, 24 Apr 2019 01:32:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5TZQXLiLO/Lv98FISN8xwT5+J8G+jgaavXz6Vx+ySi3pxLgMyZ+rR60ZUt2mzr7B2skPr X-Received: by 2002:a63:5560:: with SMTP id f32mr29709044pgm.334.1556094766514; Wed, 24 Apr 2019 01:32:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556094766; cv=none; d=google.com; s=arc-20160816; b=uGsA8/guLHJ4J7mBW4YwhQZcQtrL2bKHl+zp/LITtRLpTJqCKQPgygkEQnoivs5NOA AzxV3F4FKndAvE43ULhPhn1Fzm5K4mY135jIFH6m/vdxbxx07ASr7n/tee0/UCh4tIYd jLzFM7COTlFxxQKQI3TUWSHSGD27s8g/u1v0VPTkVgnR8M+PKbOFiltbD04kHKh5anej yEHawOmuWfzo42mGI2VDV1qFiLwN5923AtxQfhCThGO7bMTh9ZEh/0JYMPmZ052J8HEL 8JmdfuFURHMMKm//9hCWqfb5XpH52zCNJNgw2RxEcs1iI0U4JhIgken25TF0Y7HRA/4r i1bw== 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; bh=yRp0tjkwULCgCBDG+aoiFVBcT1bmT5Jz785O5JrReFU=; b=HQS8SIh/gCl3VRkIQDWHK9XxIOxbEnw2yWcL35nvmXs97ZsxW2Hbck8+3w6pZw3S54 bPmV4hyYMUIQ57yMFALPn2C271Ed+QOSuOgNUhMm6mjKickV51Z9b4aUH2l2LSjFJD1e qrW6+9kIh86I9j6eZSvQ2S0gChWdA3Z8RrdkreBj1TYQLqJ+yJFQVGMQ19S+ocdmikDf PEpb8h35Z3habjmnPzGUddJfHVFEVq8BQv7MAhfQYAwFa+h81K19/bgctZlFu0f5GhC9 OSDXg84hJHVFb7Qy7pXdOpxin1j6X3PI9AdQP4uqgNVw1971b2DbJAfBeH/Wj0NOlVtb R5Xg== 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 m15si17577743pgj.126.2019.04.24.01.32.30; Wed, 24 Apr 2019 01:32:46 -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 S1730162AbfDXIbf (ORCPT + 99 others); Wed, 24 Apr 2019 04:31:35 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:44014 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729436AbfDXIbd (ORCPT ); Wed, 24 Apr 2019 04:31:33 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x3O8UG1B142594 for ; Wed, 24 Apr 2019 04:31:32 -0400 Received: from e13.ny.us.ibm.com (e13.ny.us.ibm.com [129.33.205.203]) by mx0b-001b2d01.pphosted.com with ESMTP id 2s2k61ujun-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 24 Apr 2019 04:30:21 -0400 Received: from localhost by e13.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 24 Apr 2019 09:29:55 +0100 Received: from b01cxnp22034.gho.pok.ibm.com (9.57.198.24) by e13.ny.us.ibm.com (146.89.104.200) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 24 Apr 2019 09:29:50 +0100 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 x3O8Tnk432112772 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Apr 2019 08:29:49 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 28867B2067; Wed, 24 Apr 2019 08:29:49 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 06C55B2065; Wed, 24 Apr 2019 08:29:49 +0000 (GMT) Received: from paulmck-ThinkPad-W541 (unknown [9.85.142.230]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 24 Apr 2019 08:29:48 +0000 (GMT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 49A5016C1A95; Wed, 24 Apr 2019 01:29:48 -0700 (PDT) Date: Wed, 24 Apr 2019 01:29:48 -0700 From: "Paul E. McKenney" To: Peter Zijlstra Cc: Nicholas Piggin , LKMM Maintainers -- Akira Yokosawa , Andrea Parri , Boqun Feng , David Howells , Daniel Lustig , Jade Alglave , Kernel development list , Luc Maranget , Alan Stern , Will Deacon Subject: Re: [PATCH] Documentation: atomic_t.txt: Explain ordering provided by smp_mb__{before,after}_atomic() Reply-To: paulmck@linux.ibm.com References: <20190419180017.GP4038@hirez.programming.kicks-ass.net> <20190419182620.GF14111@linux.ibm.com> <1555719429.t9n8gkf70y.astroid@bobo.none> <20190420085440.GK14111@linux.ibm.com> <20190423121715.GQ4038@hirez.programming.kicks-ass.net> <20190423132116.GJ3923@linux.ibm.com> <20190423132620.GU4038@hirez.programming.kicks-ass.net> <20190423201637.GW3923@linux.ibm.com> <20190423202831.GA4038@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190423202831.GA4038@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 19042408-0064-0000-0000-000003D0370D X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010985; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000285; SDB=6.01193611; UDB=6.00625732; IPR=6.00974435; MB=3.00026572; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-24 08:29:53 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19042408-0065-0000-0000-00003D2F725F Message-Id: <20190424082948.GG3923@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-04-24_06:,, 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=856 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904240073 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 23, 2019 at 10:28:31PM +0200, Peter Zijlstra wrote: > On Tue, Apr 23, 2019 at 01:16:37PM -0700, Paul E. McKenney wrote: > > > Agreed, but I thought that one of the ideas going forward was to get > > rid of smp_mb__{before,after}_atomic(). > > It's not one I had considered.. I just wanted to get rid of this > 'surprise' behaviour. Ah, good point, your patch is in fact a midpoint between those two positions. Just to make sure I understand: 1. Without your patch, smp_mb__{before,after}_atomic() orders only against the atomic itself. 2. With your patch, smp_mb__{before,after}_atomic() orders against the atomic itself and the accesses on the other side of that atomic. However, it does not order the atomic against the accesses on the other side of that atomic. Putting things between the smp_mb__{before,after}_atomic() and the atomic is in my opinion a bad idea, but in this case they are not necessarily ordered. 3. Dispensing with smp_mb__{before,after}_atomic() would have void RMW atomics fully ordered, but I suspect that it results in ugly performance regressions. Or am I still missing something? Thanx, Paul