Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2861589imb; Mon, 4 Mar 2019 16:34:26 -0800 (PST) X-Google-Smtp-Source: APXvYqw4+pAEMx6PGH5EIO044SZLeA9xq76HrMpCEGO87HFN7KLYCiPYlfhF/48BJ2yF6MeeMQzz X-Received: by 2002:a17:902:d207:: with SMTP id t7mr5744516ply.216.1551746066026; Mon, 04 Mar 2019 16:34:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551746066; cv=none; d=google.com; s=arc-20160816; b=DeHimF+nMcsEP8RKmH4Jl2mFsckfMOmgu0MhpwStfhQ/myUZAYKBcetCk2Q9jhCcPQ bPCiT44UW1t2ZOaaqiY5/HRF+SNI3hFqghkk0gWyASamdBHr/Y5RwgZsE90AKaGo//aq Smu4/fTLAKepcGT3K1MlDAXBxag+PL2JU2hmAzjYUgbfqtzsw62BKgq73TZHjydX9JCl O3XDTRAsBlIj/5rSjM9/SLrAzcqBuDKDJhBZtTKqq8H2+OqteypWXPnBUeSsIFN8vkJn OjBFfmUlF1z88tv/jxCGbEDTA1SOx0zTkK6BtIexk4G4ZTpVUDhgavAU/7m/SEs99rdw uvKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=LSf70cL2RGgyOc3zQT9hIPFMQ6rAGhCNNZF5Ejd4GOA=; b=J+sbBbxAMy7qhsM+Dx7of2nFThg2JfYGz4HXFZABl6e8cBTqs9ywlDqtT9V/MCPk7Z WqNPLCDdbfc/2ZZ8zFPxZCpSVuW94ZLvb4iTvMPvJqNpC/FwDiTF/bgpELETKFogXt+8 JEDu9tj6InmOUyh9pEbZ13lquGtTFuA71KdZCs5z6qVdI7OBv+KdFVPNSSbYToNUMd4P mJPh8MXu9QqFgMBwr4wASKy1UyI8oHfjXphMyl7yLkFzKTojamPX7k4MWYWe+1rXygJG YbXnqsZtWg41cBMcK2B3suVObpJbouj0FoyHtyPR+5JmRfg4XpbjmajGJMqyxy3PG7Ut 9I9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=A8t1IllR; 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 61si6959078plz.177.2019.03.04.16.34.10; Mon, 04 Mar 2019 16:34:26 -0800 (PST) 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=@linux-foundation.org header.s=google header.b=A8t1IllR; 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 S1726697AbfCEAdn (ORCPT + 99 others); Mon, 4 Mar 2019 19:33:43 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:37955 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726080AbfCEAdn (ORCPT ); Mon, 4 Mar 2019 19:33:43 -0500 Received: by mail-lj1-f193.google.com with SMTP id 199so5994223ljj.5 for ; Mon, 04 Mar 2019 16:33:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LSf70cL2RGgyOc3zQT9hIPFMQ6rAGhCNNZF5Ejd4GOA=; b=A8t1IllR2PbXTGURjyyxZj5rCqF2+9DuN5zp+9Y/HO2WcIoHb9KfNsKQu+kDY5QsTF vfLCBXBqE6Oc9FwAx/VrPBdS5CGDnktCs6Cb54qK4wp82LhJBdQaKrXw9F6qO7eh0Zdo N54jWx8xeWcgf/iFpUsIcHcjUbkdDNO2DEmdA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LSf70cL2RGgyOc3zQT9hIPFMQ6rAGhCNNZF5Ejd4GOA=; b=CHgJBd8WPKdH4OTfY8xTjoXIO00ZhCVn7PZZocDT+LowuFEOnsf9tkTNybrzsSB2TM HZ9skjLyMnNrcXatPQ9WTAvyNqR4OxNHLrdl0K1deqKkwHBq3S8z2NTtN0S90GeFrPxu 0vAbiwL9dy/DL2Js2Npciu7gd+OZ9RqAybHfrJWy29PbdFYtcKLVSjnCRx3Qo+13/esc G6oRcDYoTOQHqiX99gqLGrLZyEVTmmeM9yis1pOdZcM0yV5ZMsVosLbRplcHc39ylc/n B5qv7BdZbiGow2xnHslQfTu8CMexUtfs9ZVc2bSXZNJnrYRA1CKcV6c3Eg9j3qJUBIhn c11w== X-Gm-Message-State: APjAAAUIQlgiC/WjIaAotJXvGhDFao7WYJKJMWCei9AN83W3j1fh6NqM hm/8SFjhxaIRBUZyw7PsyBy3FWRLiic= X-Received: by 2002:a2e:964b:: with SMTP id z11mr10918113ljh.138.1551746020378; Mon, 04 Mar 2019 16:33:40 -0800 (PST) Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com. [209.85.208.174]) by smtp.gmail.com with ESMTPSA id t11sm1756331ljj.92.2019.03.04.16.33.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Mar 2019 16:33:39 -0800 (PST) Received: by mail-lj1-f174.google.com with SMTP id z20so5981203ljj.10 for ; Mon, 04 Mar 2019 16:33:38 -0800 (PST) X-Received: by 2002:a2e:8510:: with SMTP id j16mr11977194lji.2.1551746018426; Mon, 04 Mar 2019 16:33:38 -0800 (PST) MIME-Version: 1.0 References: <20190301140348.25175-1-will.deacon@arm.com> <20190301140348.25175-2-will.deacon@arm.com> <1551575210.6lwpiqtg5k.astroid@bobo.none> <1551583190.duzqnmfnvg.astroid@bobo.none> <1551606848.8cceyn7nhv.astroid@bobo.none> <1551743521.hogpbicfcz.astroid@bobo.none> In-Reply-To: <1551743521.hogpbicfcz.astroid@bobo.none> From: Linus Torvalds Date: Mon, 4 Mar 2019 16:33:22 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 01/20] asm-generic/mmiowb: Add generic implementation of mmiowb() tracking To: Nicholas Piggin Cc: Andrea Parri , Arnd Bergmann , Benjamin Herrenschmidt , Rich Felker , David Howells , Daniel Lustig , linux-arch , Linux List Kernel Mailing , "Maciej W. Rozycki" , Ingo Molnar , Michael Ellerman , Palmer Dabbelt , Paul Burton , "Paul E. McKenney" , Peter Zijlstra , Alan Stern , Tony Luck , Will Deacon , Yoshinori Sato Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 4, 2019 at 4:21 PM Nicholas Piggin wrote: > > Well you don't have to talk about it but why do you want me to stop? > I don't understand. It's an open topic still after this series. I > can post a new thread about it if that would upset you less, I just > thought it would kind of fit here because we're talking about mmiowb, > I'm not trying to derail this series. Because if anybody is doing lockless programming with IO, they deserve whatever they get. In other words, the whole "wmb()" issue is basically not an issue. We already have rules like: - mmio is ordered wrt itself - mmio is ordered wrt previous memory ops (because of dma) and while it turned out that at least alpha had broken those rules at some point, and we had a discussion about it, that was just a bug. So there's basically no real reason to ever use "wmb()" with any of the normal mmio stuff. Now, we do have __raw_writel() etc, which are explicitly not ordered, but they also haven't been really standardized. And in fact, people who use them often seem to want to use them together with various weak memory remappings. And yes, "wmb()" has been the traditional way to order those, to the point where "wmb()" on x86 is actually a "sfence" because once you do IO on those kinds of unordered mappings, the usual SMP rules go out the window (a normal "smp_wmb()" is just a compiler barrier on x86). But notice how this is *entirely* independent of the spinlock issue, and has absolutely *nothing* to do with the whole mmiowb() thing that was always about "normal IO vs normal RAM" (due to the ia64 breakage). Linus