Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1533069yba; Sat, 27 Apr 2019 01:18:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqxajZ2KQMvEB8RUVW2HLHicEXjE3nzisK8dbzJw8W2Ccz05RoUAwDYSNMzj6wiAPrxndkE0 X-Received: by 2002:a65:5289:: with SMTP id y9mr22060805pgp.52.1556353133704; Sat, 27 Apr 2019 01:18:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556353133; cv=none; d=google.com; s=arc-20160816; b=SnquywFqZxLDOg9ooTBMkuRKWYiKFWH6jf0RLhteq6/UotmbZ62UbHPHs9xggqDXcX IYakGY6HfM+cnbB0Lolfy9MZpqthkfUdKc0xNoFYYMKMrJGmQvR4NBHDd9Rk4PDgFoif Kgcolpw2LxH3pSNDwlYtf+KQ5PuCZADRw+sahKRrIiK6BngadXDCAcFQxDWPmyE55EVV eVGaS4QrhVP+Cec1qzE48T+Q3LlBEWJLZxt9uA1b3WlrBFw/qCQWXlN2f9PIQI3fzgA2 J9+VM9zYqQFdBLq7u6nIHHYwJj9pV5HVnytg89p1Jz7/WUUw2/GZ+2M0PodtsgohIjDl SqbA== 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:message-id:subject:cc :to:from:date:dkim-signature; bh=Q01K7Ky4BKJ/pxdXFN5GOUuy31dwR07sCeBMrLpe13Q=; b=e+OI/pPSTtNxn8aBAuh78ouGdpixNwvWEnj7hrwQRIH8waicawLm7SG2xvYvTHm7Uc Q8j7DkuWHXkjsSYExn+99LJnRBq1R+CGkRalbMUdW9bPoU3XV2l/rNWnLbxrywncvgHp iHztH2KbZH+Zrf9H5I6AF8MMuReVPOZjCUF2VevvX+bWRKwSG5yp4dzq18cW+ifTvFj7 b/h6OeZSe3wbszdpaEjGi0n1iQ/1TeDxQrW75ZfSgPBA40BFsuCpQ/vrMpff0SaoeV37 I0RPnZATAI5JDiwJCXTWeHAKEjJIe6eqijuzvtomjrsGoErt0QKTh2aGWRkYtvswaTMt IatA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=O3KVfron; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o123si29492063pfb.116.2019.04.27.01.18.38; Sat, 27 Apr 2019 01:18:53 -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; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=O3KVfron; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726005AbfD0IRs (ORCPT + 99 others); Sat, 27 Apr 2019 04:17:48 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:36526 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725857AbfD0IRs (ORCPT ); Sat, 27 Apr 2019 04:17:48 -0400 Received: by mail-wr1-f66.google.com with SMTP id b1so7740411wru.3 for ; Sat, 27 Apr 2019 01:17:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Q01K7Ky4BKJ/pxdXFN5GOUuy31dwR07sCeBMrLpe13Q=; b=O3KVfronCxGnoc/6ysQ8EVduLFY9PqpholsaHDl3xJT06oWYf6YKg7ljnf3pzCF8ru ByY6OprY6cVjAhe7PzUV6AKfw4cJ4ZUk+keTg/Otef/AplTguh0qSaoqkR0GqbP5stjJ NHSYa+9+T1ijrIja3wo07VJ1Littuol91nU40= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Q01K7Ky4BKJ/pxdXFN5GOUuy31dwR07sCeBMrLpe13Q=; b=nco3sSy7QPgpcEMqf/G8jGiio4a8t8YbbBAPxYWStq7vLPE6m+MAYgM62e9k5thzCO 6wiwX3iwXx5l4A6hGZ4axswXNTRHdA3hq/E8dAJbssG3M6pWD4osYnl0OXJQidWg90RC zpzzyc0QFsGq6qF1QLhVbiSjw1Wn+jfHWn6kCbW9aqKIQs2oTCuPq23ul+HKyMPKNgWL 9tMiptXkjnDCqn5zhpvibEMR64JWMHXkKSEZoLhygF1tN9KmAbCsEwx6tHXnpa9k5+d1 0rS5bPmoouD5v425jzY4BRUDeHFGUEoLNpldaAwY316Ta3mpFaOazFzw3Oc4efxoAT6z aeUA== X-Gm-Message-State: APjAAAWbtZAbSUI+1k2rhZN7SgYxChsHl5mCctRqPhjIOBmtSSkEcK+d etdg8LemfqeSMC5LO/AikGFXRg== X-Received: by 2002:adf:d081:: with SMTP id y1mr6533969wrh.283.1556353066536; Sat, 27 Apr 2019 01:17:46 -0700 (PDT) Received: from andrea (host116-65-dynamic.49-79-r.retail.telecomitalia.it. [79.49.65.116]) by smtp.gmail.com with ESMTPSA id o16sm24254238wrw.10.2019.04.27.01.17.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Apr 2019 01:17:45 -0700 (PDT) Date: Sat, 27 Apr 2019 10:17:38 +0200 From: Andrea Parri To: "Paul E. McKenney" 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() Message-ID: <20190427081738.GA11149@andrea> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190423133010.GK3923@linux.ibm.com> User-Agent: Mutt/1.5.24 (2015-08-30) 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 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