From: Brent Casavant <bcasavan@sgi.com>
To: Jesse Barnes <jesse.barnes@intel.com>
Cc: Nick Piggin <npiggin@suse.de>,
linux-ia64@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
linuxppc-dev@ozlabs.org
Subject: Re: wmb vs mmiowb
Date: Tue, 28 Aug 2007 21:21:04 +0000 [thread overview]
Message-ID: <20070828155714.Q5403@pkunk.americas.sgi.com> (raw)
In-Reply-To: <200708230956.17049.jesse.barnes@intel.com>
On Thu, 23 Aug 2007, Jesse Barnes wrote:
> On Thursday, August 23, 2007 12:27 am Benjamin Herrenschmidt wrote:
> > > Of course, the normal memory barrier would usually be a
> > > "spin_unlock()" or something like that, not a "wmb()". In fact, I
> > > don't think the powerpc implementation (as an example of this) will
> > > actually synchronize with anything *but* a spin_unlock().
> >
> > We are even more sneaky in the sense that we set a per-cpu flag on
> > any MMIO write and do the sync automatically in spin_unlock() :-)
>
> Yeah, that's a reasonable thing to do, and in fact I think there's code
> to do something similar when a task is switched out (this keeps user
> level drivers from having do mmiowb() type things).
Yes there is, git commit e08e6c521355cd33e647b2f739885bc3050eead6.
On SN2 any user process performing memory-mapped IO directly to a
device needs something like mmiowb() to be performed at the node of
the CPU it last ran on when the task context switches onto a new CPU.
The current code performs this action for all inter-CPU context
switches, but we had discussed the possibility of targetting the
action only when the user process has actually mapped a device for
IO. I believe it was decided that this level of complexity wasn't
warranted unless this simple solution was found to cause a problem.
That reminds me. Are the people who are working on the user-level
driver effort including a capability similar to mmiowb()? If we
had that capability we could eventually do away with the change
mentioned above. But that would come after all user-level drivers
were coded to include the mmiowb()-like calls, and existing drivers
which provide mmap() capability directly to hardware go away.
Brent
--
Brent Casavant All music is folk music. I ain't
bcasavan@sgi.com never heard a horse sing a song.
Silicon Graphics, Inc. -- Louis Armstrong
next prev parent reply other threads:[~2007-08-28 21:21 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-22 4:57 wmb vs mmiowb Nick Piggin
2007-08-22 18:07 ` Linus Torvalds
2007-08-22 19:02 ` Jesse Barnes
2007-08-23 2:20 ` Nick Piggin
2007-08-23 2:57 ` Linus Torvalds
2007-08-23 3:54 ` Nick Piggin
2007-08-23 16:14 ` Linus Torvalds
2007-08-23 4:20 ` Nick Piggin
2007-08-23 16:16 ` Linus Torvalds
2007-08-23 16:27 ` Benjamin Herrenschmidt
2007-08-24 3:09 ` Nick Piggin
2007-08-28 20:56 ` Brent Casavant
2007-08-29 0:59 ` Nick Piggin
2007-08-29 18:53 ` Brent Casavant
2007-08-30 3:36 ` Nick Piggin
2007-08-30 19:42 ` Brent Casavant
2007-09-03 20:48 ` Nick Piggin
2007-08-24 2:59 ` Nick Piggin
2007-08-23 17:02 ` Jesse Barnes
2007-08-23 1:59 ` Nick Piggin
2007-08-23 7:27 ` Benjamin Herrenschmidt
2007-08-23 16:56 ` Jesse Barnes
2007-08-24 3:12 ` Nick Piggin
2007-08-28 21:21 ` Brent Casavant [this message]
2007-08-28 23:01 ` Peter Chubb
2007-08-23 7:25 ` 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=20070828155714.Q5403@pkunk.americas.sgi.com \
--to=bcasavan@sgi.com \
--cc=jesse.barnes@intel.com \
--cc=linux-ia64@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=npiggin@suse.de \
--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