Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3587723yba; Tue, 23 Apr 2019 06:28:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwcIDA4DQ9dYgmJTG2fKvfW/4P4s8iirX0DguSSygkJIPlHVTyvtVDkKsWFVFwSHg3cf0d1 X-Received: by 2002:aa7:9e9a:: with SMTP id p26mr26727426pfq.201.1556026111943; Tue, 23 Apr 2019 06:28:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556026111; cv=none; d=google.com; s=arc-20160816; b=PJf0BwQ+7tHADugun7vPgPGRcqlwBkuKWo9jYkKwAvWjW2tXQXr7a69NoTV2Ek2SvG hzHmoAdWoQ8J+J6OaAg8fGbUwn/8hvxUsPD+PSCWuGi2Rwx/Xq0E5tqANAaBZfPSAWG5 24qfTY4tHq8WQK+5qdMFD4NqODf/jSek7VvLt9xfMxjidLwnFsvIn5BgoMfzNz5bB1ZQ pMd/jcOQnP16RMKnBpINQrWRh35YEQP6vc/szOT+XFfy6EB3YOpT/pGJWgjeIC1S6fzL 2WjNu/PhDQ3m60TSItVdwHuk1nFsInYV0TO50pv9G22tT3Y/Mo+DWXlu/nyCk1fmme3L 7Esg== 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=BdM6CArgxEm22HVbHd3GaZ5CV6hbS9CSRE8mWJGcDtc=; b=AxqUpd/kPDSrU8MeMlM1E1014eOykYWsFsrF3P9zxv3tfv8DHgtL+5X4Ynm+PL7J27 CFUoLQPUSxYRFtxeUvoHwz4sMSiipK/NzR9GT72ewDToY32kwzW2zxy/r723vyk1nwtd d1eRv/DTESdhE4qbaJ7md3NN/UuFVYE3iocof2tvWlq5Q9Uzla/N+0miAzzGNuJfkRGP CaOKp8ryQbg8SugnFUriC5cRWfHBNeD3gZ4NJPU3Ca8dkHXhI6EWLwtTl/VsPh9WN3Fp Eb/cQAkCD4Q3mjyXLhzyHhWL7Lw+qWNPfGuqv+l/iddOSHsJfpIQqGWxUbbpSk1XLc9q 2G1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=RJ4R54eN; 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 t15si15443815pgq.235.2019.04.23.06.28.16; Tue, 23 Apr 2019 06:28:31 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=RJ4R54eN; 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 S1727854AbfDWN0g (ORCPT + 99 others); Tue, 23 Apr 2019 09:26:36 -0400 Received: from merlin.infradead.org ([205.233.59.134]:49290 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726421AbfDWN0f (ORCPT ); Tue, 23 Apr 2019 09:26:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=BdM6CArgxEm22HVbHd3GaZ5CV6hbS9CSRE8mWJGcDtc=; b=RJ4R54eN+qh1iuz/f39xpMin1 BFHUaJ/xdY+5M84Z9GZ8bVrNb+OeGnqiX8Z/G/HZBBgFDmtgC09JwD+6S6HhM0YRZUIIV8rhej1bD VD862VKwmY66Bxvt3yArtQYKrnFODhEmAqvovixM96iKBn/FaJfKqgV/bgf57FUpW+G7j7n0zO+LK RYUL+XmZtiRhSwUMtmfDU6y3WwNWqu1Aig6opZYRLbm8I25R2/0V8F18dlmjQ4QzqWEOuEMimXiF6 ZyqeQM+jdYl73H5dToPNZeSJZRPBnTMKs835ucgxNGlf8xAULWUthmTuGlBnp1C+6pMgWXdsnakMp dlamRMA7w==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hIvRG-0004mU-D1; Tue, 23 Apr 2019 13:26:22 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 9468229C2338C; Tue, 23 Apr 2019 15:26:20 +0200 (CEST) Date: Tue, 23 Apr 2019 15:26:20 +0200 From: Peter Zijlstra To: "Paul E. McKenney" 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() Message-ID: <20190423132620.GU4038@hirez.programming.kicks-ass.net> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190423132116.GJ3923@linux.ibm.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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:21:16AM -0700, Paul E. McKenney wrote: > On Tue, Apr 23, 2019 at 02:17:15PM +0200, Peter Zijlstra wrote: > > On Sat, Apr 20, 2019 at 01:54:40AM -0700, Paul E. McKenney wrote: > > > 3. Make non-value-returning atomics provide full ordering. > > > This would of course need some benchmarking, but would be a > > > simple change to make and would eliminate a large class of > > > potential bugs. My guess is that the loss in performance > > > would be non-negligible, but who knows? > > > > Well, only for the architectures that have > > smp_mb__{before,after}_atomic() as barrier(), which are: ia64, mips, > > s390, sparc, x86 and xtense. > > The weakly ordered architectures would need to add the equivalent of > smp_mb() before and after, right? This might result in a more noticeable > loss of performance. The weak archs already have: smp_mb__{before,after}_atomic() := smp_mb().