Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1547307yba; Sat, 27 Apr 2019 01:41:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqys6vt7x2zCONP8dLpY3AvOMX6QMhtwYCPhJzpC1A9WBkjyUOIQ9u+MubKTu7xmtO8KR0vJ X-Received: by 2002:a63:d916:: with SMTP id r22mr13637563pgg.149.1556354507032; Sat, 27 Apr 2019 01:41:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556354507; cv=none; d=google.com; s=arc-20160816; b=uZznOxKYJ2/rxTHoBN3OyuAB8Am3V4wK4p7Q9JfsdHB6ZA9jT3tPI9geUP6zN5gQOh Toi3Z14W22+dqnjKWOq5k3fvpsPGYiF78SZAHb2R9cg734hIPLRfiamBgFu7Fo4pqc/y gO6OaRif4UTe/qR02tXJZhjZXqdJsWjpB+P5eQyuU8Z7121DsE3NgeGvo0M2ts4mY3pZ p2LLYobRQEeBtwII5vu9VDdISabM07hSOK06g3XLguDamQZCC0JLhFIjPnbtMCBRlt07 7FQblMvS4W8XOd8RoIrBoBtPIzofTC1ITGtMq+7jTNzR9hxHnRKUraSc/EPZ1ZCT9m3+ ArNQ== 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=i07e6vpQnWxWJxrJeSMbLFAoygXZGBGBESS7oXf5jHA=; b=AmPEX4b6wX0WgIYhyqTUI4ByAhYocE/kOWVs+vb+g3MJ3A1idR8cYuymLu9jEvoTh2 QBebRmZoRK02I6QR1D6Jrjlk/MvhBisWSaDWjXnDyrqw46aafU8vy2p5MnH5rT6ZgzhV wKHL6rkv1higw0N0A9NuSeLYSdsMZIvX+sZyj517QjbCuOOOwBk1AHc/Z96szsyqUICN wM9yf4600pVlfk8Xh2ks/JPXw9BVKp1AxpcMw5CZcWAROHsNu2XF3NCFVcPp4v+Gh2xX Rsyhc6CFy2mhrErgGFkl8F2hk2yYC49idJc0PSr6Gwf+jyOMuUxb5AGEMtdGRNKuxBIr XXJg== 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 k6si28560374pfc.122.2019.04.27.01.41.31; Sat, 27 Apr 2019 01:41:47 -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 S1726155AbfD0Ihw (ORCPT + 99 others); Sat, 27 Apr 2019 04:37:52 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:54310 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726019AbfD0Ihv (ORCPT ); Sat, 27 Apr 2019 04:37:51 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x3R8YG0s088963 for ; Sat, 27 Apr 2019 04:37:50 -0400 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0a-001b2d01.pphosted.com with ESMTP id 2s4km487k5-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 27 Apr 2019 04:37:50 -0400 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 27 Apr 2019 09:37:49 +0100 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Sat, 27 Apr 2019 09:37:45 +0100 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x3R8aUCw34799754 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 27 Apr 2019 08:36:30 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 33855B2064; Sat, 27 Apr 2019 08:36:30 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0B67CB205F; Sat, 27 Apr 2019 08:36:30 +0000 (GMT) Received: from paulmck-ThinkPad-W541 (unknown [9.85.147.138]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Sat, 27 Apr 2019 08:36:30 +0000 (GMT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 9963216C1355; Sat, 27 Apr 2019 01:36:29 -0700 (PDT) Date: Sat, 27 Apr 2019 01:36:29 -0700 From: "Paul E. McKenney" To: Andrea Parri Cc: Peter Zijlstra , Nicholas Piggin , LKMM Maintainers -- Akira Yokosawa , 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> <20190423123209.GR4038@hirez.programming.kicks-ass.net> <20190423133010.GK3923@linux.ibm.com> <20190427081738.GA11149@andrea> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190427081738.GA11149@andrea> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 19042708-0060-0000-0000-000003355F4E X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011003; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000285; SDB=6.01195033; UDB=6.00626597; IPR=6.00975875; MB=3.00026620; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-27 08:37:48 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19042708-0061-0000-0000-0000491D6C2B Message-Id: <20190427083629.GJ3923@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-04-27_02:,, 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=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904270064 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 27, 2019 at 10:17:38AM +0200, Andrea Parri wrote: > On Tue, Apr 23, 2019 at 06:30:10AM -0700, Paul E. McKenney wrote: > > On Tue, Apr 23, 2019 at 02:32:09PM +0200, Peter Zijlstra wrote: > > > On Sat, Apr 20, 2019 at 01:54:40AM -0700, Paul E. McKenney wrote: > > > > And atomic_set(): set_preempt_state(). This fails > > > > on x86, s390, and TSO friends, does it not? Or is > > > > this ARM-only? Still, why not just smp_mb() before and > > > > after? Same issue in __kernfs_new_node(), bio_cnt_set(), > > > > sbitmap_queue_update_wake_batch(), > > > > > > > > Ditto for atomic64_set() in __ceph_dir_set_complete(). > > > > > > > > Ditto for atomic_read() in rvt_qp_is_avail(). This function > > > > has a couple of other oddly placed smp_mb__before_atomic(). > > > > > > That are just straight up bugs. The atomic_t.txt file clearly specifies > > > the barriers only apply to RmW ops and both _set() and _read() are > > > specified to not be a RmW. > > > > Agreed. The "Ditto" covers my atomic_set() consternation. ;-) > > I was working on some of these before the Easter break [1, 2]: the plan > was to continue next week, but by addressing the remaining cases with a > conservative s/that barrier/smp_mb at first; unless you've other plans? > > Andrea > > [1] http://lkml.kernel.org/r/1555417031-27356-1-git-send-email-andrea.parri@amarulasolutions.com > [2] http://lkml.kernel.org/r/1555404968-39927-1-git-send-email-pbonzini@redhat.com Sounds good to me! ;-) Thanx, Paul