From: Will Deacon <will.deacon@arm•com>
To: Benjamin Herrenschmidt <benh@kernel•crashing.org>
Cc: Nicholas Piggin <npiggin@gmail•com>,
David Miller <davem@davemloft•net>,
paulmck@linux•vnet.ibm.com, arnd@arndb•de,
linux-rdma@vger•kernel.org, linuxppc-dev@lists•ozlabs.org,
linus971@gmail•com, alexander.duyck@gmail•com,
okaya@codeaurora•org, jgg@ziepe•ca, David.Laight@aculab•com,
oohall@gmail•com, netdev@vger•kernel.org,
alexander.h.duyck@redhat•com, torvalds@linux-foundation•org
Subject: Re: RFC on writel and writel_relaxed
Date: Thu, 29 Mar 2018 10:20:47 +0100 [thread overview]
Message-ID: <20180329092046.GB22926@arm.com> (raw)
In-Reply-To: <1522272692.21446.42.camel@kernel.crashing.org>
On Thu, Mar 29, 2018 at 08:31:32AM +1100, Benjamin Herrenschmidt wrote:
> On Thu, 2018-03-29 at 02:23 +1000, Nicholas Piggin wrote:
> > This is a variation on the mandatory write barrier that causes writes to weakly
> > ordered I/O regions to be partially ordered. Its effects may go beyond the
> > CPU->Hardware interface and actually affect the hardware at some level.
> >
> > How can a driver writer possibly get that right?
> >
> > IIRC it was added for some big ia64 system that was really expensive
> > to implement the proper wmb() semantics on. So wmb() semantics were
> > quietly downgraded, then the subsequently broken drivers they cared
> > about were fixed by adding the stronger mmiowb().
> >
> > What should have happened was wmb and writel remained correct, sane, and
> > expensive, and they add an mmio_wmb() to order MMIO stores made by the
> > writel_relaxed accessors, then use that to speed up the few drivers they
> > care about.
> >
> > Now that ia64 doesn't matter too much, can we deprecate mmiowb and just
> > make wmb ordering talk about stores to the device, not to some
> > intermediate stage of the interconnect where it can be subsequently
> > reordered wrt the device? Drivers can be converted back to using wmb
> > or writel gradually.
>
> I was under the impression that mmiowb was specifically about ordering
> writel's with a subsequent spin_unlock, without it, MMIOs from
> different CPUs (within the same lock) would still arrive OO.
>
> If that's indeed the case, I would suggest ia64 switches to a similar
> per-cpu flag trick powerpc uses.
... or we could remove ia64.
/me runs for cover
Will
next prev parent reply other threads:[~2018-03-29 9:20 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1521692689.16434.293.camel@kernel.crashing.org>
[not found] ` <CAOSf1CFv1HHCL3YOVhRn2U=grdNjaQ=A4m3xwxN2Rek1-_TySg@mail.gmail.com>
[not found] ` <1521726722.16434.312.camel@kernel.crashing.org>
[not found] ` <20180323163510.GC13033@ziepe.ca>
[not found] ` <1521854626.16434.359.camel@kernel.crashing.org>
[not found] ` <58ce5b83f40f4775bec1be8db66adb0d@AcuMS.aculab.com>
[not found] ` <20180326165425.GA15554@ziepe.ca>
[not found] ` <CAK8P3a1zeMyj+Z-y4ER4moY6Zip9EWNOinf+VnboGOrgiwbBZA@mail.gmail.com>
[not found] ` <20180326202545.GB15554@ziepe.ca>
[not found] ` <CAK8P3a3fc43ZcW626hmsd3DVcLw7hGkdUMxp7s4Rn3mdkziwMQ@mail.gmail.com>
[not found] ` <20180326210951.GD15554@ziepe.ca>
[not found] ` <CAK8P3a2UU1xAM0NLo7Q4-Xgo1SzY3De1uqpFudr+2ZW7nHEPmA@mail.gmail.com>
[not found] ` <1522101616.7364.13.camel@kernel.crashing.org>
2018-03-27 14:46 ` RFC on writel and writel_relaxed Sinan Kaya
2018-03-27 15:01 ` Jose Abreu
2018-03-27 15:10 ` Will Deacon
2018-03-27 18:54 ` Alexander Duyck
2018-03-27 19:54 ` Arnd Bergmann
2018-03-27 20:46 ` Arnd Bergmann
2018-03-27 21:33 ` Benjamin Herrenschmidt
2018-03-28 0:39 ` Linus Torvalds
2018-03-28 1:03 ` Benjamin Herrenschmidt
2018-03-28 2:51 ` Linus Torvalds
2018-03-28 3:24 ` Sinan Kaya
2018-03-28 4:41 ` Benjamin Herrenschmidt
2018-03-28 6:14 ` Linus Torvalds
2018-03-28 11:41 ` okaya
2018-03-28 15:13 ` Benjamin Herrenschmidt
2018-03-28 15:55 ` David Miller
2018-03-28 16:23 ` Nicholas Piggin
2018-03-28 21:31 ` Benjamin Herrenschmidt
2018-03-28 22:09 ` Nicholas Piggin
2018-03-29 9:20 ` Will Deacon [this message]
2018-03-29 13:56 ` Sinan Kaya
2018-03-29 14:04 ` David Miller
2018-03-29 16:29 ` Arnd Bergmann
2018-03-29 16:59 ` Sinan Kaya
2018-03-30 1:40 ` Benjamin Herrenschmidt
2018-04-02 13:01 ` Sinan Kaya
2018-03-28 4:33 ` Benjamin Herrenschmidt
2018-03-28 6:26 ` Linus Torvalds
2018-03-28 6:42 ` Benjamin Herrenschmidt
2018-03-28 6:53 ` Linus Torvalds
2018-03-28 6:56 ` Benjamin Herrenschmidt
2018-03-28 7:11 ` Arnd Bergmann
2018-03-28 7:42 ` Benjamin Herrenschmidt
2018-03-28 9:07 ` Will Deacon
2018-03-28 9:56 ` Benjamin Herrenschmidt
2018-03-28 10:13 ` Aw: " Lino Sanfilippo
2018-03-28 10:20 ` Benjamin Herrenschmidt
2018-03-28 11:30 ` David Laight
2018-03-28 15:12 ` Benjamin Herrenschmidt
2018-03-28 16:16 ` David Laight
2018-03-28 1:21 ` Benjamin Herrenschmidt
2018-03-27 21:35 ` Benjamin Herrenschmidt
2018-03-27 21:54 Alexander Duyck
2018-03-27 22:35 ` Sinan Kaya
2018-03-27 23:43 ` Benjamin Herrenschmidt
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=20180329092046.GB22926@arm.com \
--to=will.deacon@arm$(echo .)com \
--cc=David.Laight@aculab$(echo .)com \
--cc=alexander.duyck@gmail$(echo .)com \
--cc=alexander.h.duyck@redhat$(echo .)com \
--cc=arnd@arndb$(echo .)de \
--cc=benh@kernel$(echo .)crashing.org \
--cc=davem@davemloft$(echo .)net \
--cc=jgg@ziepe$(echo .)ca \
--cc=linus971@gmail$(echo .)com \
--cc=linux-rdma@vger$(echo .)kernel.org \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=npiggin@gmail$(echo .)com \
--cc=okaya@codeaurora$(echo .)org \
--cc=oohall@gmail$(echo .)com \
--cc=paulmck@linux$(echo .)vnet.ibm.com \
--cc=torvalds@linux-foundation$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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