public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Will Deacon <will.deacon@arm.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-arch <linux-arch@vger.kernel.org>,
	Linux List Kernel Mailing <linux-kernel@vger.kernel.org>,
	"Paul E. McKenney" <paulmck@linux.ibm.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrea Parri <andrea.parri@amarulasolutions.com>,
	Daniel Lustig <dlustig@nvidia.com>,
	David Howells <dhowells@redhat.com>,
	Alan Stern <stern@rowland.harvard.edu>,
	tony.luck@intel.com
Subject: Re: [RFC PATCH] docs/memory-barriers.txt: Rewrite "KERNEL I/O BARRIER EFFECTS" section
Date: Wed, 13 Feb 2019 17:20:47 +0000	[thread overview]
Message-ID: <20190213172047.GH6346@brain-police> (raw)
In-Reply-To: <CAHk-=wiP42aqBApAUJbLAB43u5ips9ArgLxXn5L1r74bowxdow@mail.gmail.com>

[+Tony]

On Mon, Feb 11, 2019 at 02:34:31PM -0800, Linus Torvalds wrote:
> On Mon, Feb 11, 2019 at 9:30 AM Will Deacon <will.deacon@arm.com> wrote:
> >
> > +
> > +     1. All readX() and writeX() accesses to the same peripheral are ordered
> > +        with respect to each other. For example, this ensures that MMIO register
> > +       writes by the CPU to a particular device will arrive in program order.
> 
> Hmm. I'd like more people look at strengthening this one wrt across
> CPUs and locking.
> 
> Right now we document mmiowb(), but that "documentation" is really
> just a fairy tale. Very *very* few drivers actually do mmiowb() on
> their own.
> 
> IOW, we should seriously just consider making the rule be that locking
> will order mmio too. Because that's practically the rule anyway.

I would /love/ to get rid of mmiowb() because I think it's both extremely
difficult to use and also pretty much never needed. It reminds me a lot of
smp_read_barrier_depends(), which we finally pushed into READ_ONCE for
Alpha.

> Powerpc already does it. IO within a locked region will serialize with the
> lock.

I thought ia64 was the hold out here? Did they actually have machines that
needed this in practice? If so, I think we can either:

  (a) Add an mmiowb() to their spin_unlock() code, or
  (b) Remove ia64 altogether if nobody complains

I know that Peter has been in favour of (b) for a while...

Will

  parent reply	other threads:[~2019-02-13 17:20 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-11 17:29 [RFC PATCH] docs/memory-barriers.txt: Rewrite "KERNEL I/O BARRIER EFFECTS" section Will Deacon
2019-02-11 17:29 ` Will Deacon
2019-02-11 20:22 ` Paul E. McKenney
2019-02-11 20:22   ` Paul E. McKenney
2019-02-12 18:43   ` Will Deacon
2019-02-12 18:43     ` Will Deacon
2019-02-12 19:24     ` Paul E. McKenney
2019-02-12 19:24       ` Paul E. McKenney
2019-02-11 22:34 ` Linus Torvalds
2019-02-11 22:34   ` Linus Torvalds
2019-02-12  4:01   ` Benjamin Herrenschmidt
2019-02-12  4:01     ` Benjamin Herrenschmidt
2019-02-13 17:20   ` Will Deacon [this message]
2019-02-13 17:20     ` Will Deacon
2019-02-13 18:27     ` Linus Torvalds
2019-02-13 18:27       ` Linus Torvalds
2019-02-13 18:33       ` Peter Zijlstra
2019-02-13 18:33         ` Peter Zijlstra
2019-02-13 18:43         ` Luck, Tony
2019-02-13 18:43           ` Luck, Tony
2019-02-13 19:31           ` Paul E. McKenney
2019-02-13 19:31             ` Paul E. McKenney
2019-02-18 16:50       ` Will Deacon
2019-02-18 16:50         ` Will Deacon
2019-02-19 16:13         ` Will Deacon
2019-02-19 16:13           ` Will Deacon
2019-02-21  6:22           ` Michael Ellerman
2019-02-21  6:22             ` Michael Ellerman
2019-02-22 17:38             ` Will Deacon
2019-02-22 17:38               ` Will Deacon
2019-02-12 13:03 ` Arnd Bergmann
2019-02-12 13:03   ` Arnd Bergmann
2019-02-18 16:29   ` Will Deacon
2019-02-18 16:29     ` Will Deacon
2019-02-18 16:59     ` Arnd Bergmann
2019-02-18 16:59       ` Arnd Bergmann
2019-02-18 17:56       ` Will Deacon
2019-02-18 17:56         ` Will Deacon
2019-02-18 20:37         ` Arnd Bergmann
2019-02-18 20:37           ` Arnd Bergmann
2019-02-19 10:27           ` Thomas Petazzoni
2019-02-19 10:27             ` Thomas Petazzoni
2019-02-19 11:31             ` Arnd Bergmann
2019-02-19 11:31               ` Arnd Bergmann
2019-02-19 11:36               ` Will Deacon
2019-02-19 11:36                 ` Will Deacon
2019-02-19 13:01                 ` Arnd Bergmann
2019-02-19 13:01                   ` Arnd Bergmann
2019-02-19 13:20                   ` Will Deacon
2019-02-19 13:20                     ` Will Deacon
2019-02-19 13:45                     ` Arnd Bergmann
2019-02-19 13:45                       ` Arnd Bergmann
2019-02-19 11:34             ` Will Deacon
2019-02-19 11:34               ` Will Deacon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190213172047.GH6346@brain-police \
    --to=will.deacon@arm.com \
    --cc=andrea.parri@amarulasolutions.com \
    --cc=arnd@arndb.de \
    --cc=benh@kernel.crashing.org \
    --cc=dhowells@redhat.com \
    --cc=dlustig@nvidia.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@linux.ibm.com \
    --cc=peterz@infradead.org \
    --cc=stern@rowland.harvard.edu \
    --cc=tony.luck@intel.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox