public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@sgi.com>
To: Dan Maas <dmaas@dcine.com>
Cc: David Mosberger <davidm@hpl.hp.com>,
	linux-kernel@vger.kernel.org,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Ben Collins <bcollins@debian.org>
Subject: Re: readl/writel and memory barriers
Date: Tue, 19 Feb 2002 12:23:10 -0800	[thread overview]
Message-ID: <20020219122310.A1510182@sgi.com> (raw)
In-Reply-To: <092401c1b8e7$1d190660$1a01a8c0@allyourbase> <15474.34580.625864.963930@napali.hpl.hp.com> <20020219103506.A1511175@sgi.com> <0a5301c1b981$a921f820$1a01a8c0@allyourbase>
In-Reply-To: <0a5301c1b981$a921f820$1a01a8c0@allyourbase>

On Tue, Feb 19, 2002 at 03:11:45PM -0500, Dan Maas wrote:
> I have a hunch that many drivers will break if you change the semantics of
> readX/writeX from in-order to out-of-order - lots of drivers are only
> developed & tested on x86, which completely hides the issue...

Fortunately, I don't think things are quite that bad.  As David
pointed out, on ia64 the readX/writeX stuff is ordered coming out of
the CPU, so if you're in a spinlock protected region, for example, all
the reads/writes you do will occur in order.  The problem that I'm
trying to solve is that on some platforms, I/O space references won't
necessarily occur in order if they come from different CPUs.  E.g.
after you do some I/O and drop a spinlock, another CPU may pick it up
and start doing some I/O that *may* get intermixed with the I/O from
the previous holder of the spinlock unless you explicity barrier said
I/O.

Any ideas on how to address this issue?  I was thinking of either
introducing an I/O space barrier (currently called mmiob() in the 2.5
ia64 patch) or taking the performance hit in mb, rmb, and wmb, as well
as readX/writeX to ensure proper ordering.  Or, as I mentioned in
another mail, we could have a special io_spin_unlock routine that does
the barrier for you.  Comments?

Thanks,
Jesse

  reply	other threads:[~2002-02-19 20:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-19  1:45 readl/writel and memory barriers Dan Maas
2002-02-19  9:31 ` Alan Cox
2002-02-19 17:10 ` David Mosberger
2002-02-19 18:35   ` Jesse Barnes
2002-02-19 19:33     ` David Mosberger
2002-02-19 19:42       ` Jesse Barnes
2002-02-19 20:11     ` Dan Maas
2002-02-19 20:23       ` Jesse Barnes [this message]
2002-02-19 22:05     ` Keith Owens
2002-02-19 22:17       ` Jesse Barnes
2002-02-21  0:29       ` Randy.Dunlap
2002-02-23  4:48         ` Daniel Phillips
2002-02-25 16:19           ` Randy.Dunlap

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=20020219122310.A1510182@sgi.com \
    --to=jbarnes@sgi.com \
    --cc=bcollins@debian.org \
    --cc=benh@kernel.crashing.org \
    --cc=davidm@hpl.hp.com \
    --cc=dmaas@dcine.com \
    --cc=linux-kernel@vger.kernel.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