linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Jes Sorensen <Jes.Sorensen@cern.ch>
To: Jesper Skov <jskov@cygnus.co.uk>
Cc: Cort Dougan <cort@persephone.cs.nmt.edu>,
	linuxppc-dev@lists.linuxppc.org, alan@cymru.net,
	Linux/APUS mailing list <linux-apus@sunsite.auc.dk>
Subject: Re: Synchronization [was Re: The Magic Show: kernel_map() disappearing]
Date: 14 Jan 1999 10:55:37 +0100	[thread overview]
Message-ID: <d390f69o12.fsf@valhall.cern.ch> (raw)
In-Reply-To: Jesper Skov's message of "Thu, 14 Jan 1999 08:57:16 +0000 (GMT)"


>>>>> "Jesper" == Jesper Skov <jskov@cygnus.co.uk> writes:

>>>>> "Cort" == Cort Dougan <cort@persephone.cs.nmt.edu> writes:
Cort> You're right, that was an oversight on my part.  I'll fix the
Cort> mistake.  I'll commit that to vger now.  I'm going to leave the
Cort> sync in there as well, to make sure that things stall until the
Cort> writes are done.

Jesper> OK, core of the problem is that I don't know what mb() is
Jesper> supposed to do. Here's what we have on the PPC:

mb() is supposed to ensure that the CPU does not reschedule
instructions' memory access beyond the mb().

Jesper>  sync : stall CPU until all IO has completed.  eieio: prevent
Jesper> CPU from reordering/collapsing reads/writes to memory.  (but
Jesper> otherwise run at full steam!)

[snip]

Jesper> That's why I added the iobarrier() macros (adding _w/_r/_rw on
Jesper> Alan's request) that are only related to IO synchronization
Jesper> within the same CPU. Essentially it's just renaming the
Jesper> eieio() macro already used in many PPC drivers because it's a
Jesper> bad name; Linux/APUS will be sharing drivers with Linux/m68k
Jesper> where eieio isn't such a helpful name.

Jesper> Given that mb() was defined as sync, I assumed mb() to be the
Jesper> common Linux name for a thingie used for SMP synchronization.

I guess you would normally use a spinlock() for that, mb() is supposed
to ensure the ordering regarding access to memory which is really what
is happening in most of our drivers (at least all the Amiga ones) -
this is why I was moaning about the iobarrier() stuff as it was not
clear to me what it was supposed to do differently from mb() - except
if you want ordering when going out on an I/O bus like on the PC.

Jesper> I may have been wrong. iobarrier() may not be such a good name
Jesper> after all, but I think it's important for the names to reflect
Jesper> the semantics of the function. And there are two separate
Jesper> synchronization semantics required (at least on the PPC) - I
Jesper> don't want to merge them just because there's already a common
Jesper> Linux function that's named mb() (memory barrier, presumably).

When considering the name, memory barrier is the right name, after
all, all your driver registers are memory mapped and therefore `just'
another type of memory.

Jes

[[ This message was sent via the linuxppc-dev mailing list. Replies are ]]
[[ not forced back to the list, so be sure to  Cc linuxppc-dev  if your ]]
[[ reply is of general interest. To unsubscribe from linuxppc-dev, send ]]
[[ the message 'unsubscribe' to linuxppc-dev-request@lists.linuxppc.org ]]

  reply	other threads:[~1999-01-14  9:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <13980.23937.676502.388522@lassi.cygnus.co.uk>
     [not found] ` <Pine.LNX.3.96.990113130000.3632F-100000@persephone.cs.nmt.edu>
1999-01-14  8:57   ` Synchronization [was Re: The Magic Show: kernel_map() disappearing] Jesper Skov
1999-01-14  9:55     ` Jes Sorensen [this message]
1999-01-14 16:25       ` luther sven
1999-01-14 13:27     ` Benjamin Herrenschmidt
1999-01-14 19:46     ` Douglas Godfrey
1999-01-14 20:52     ` Alan Cox
1999-01-14 21:53       ` Cort Dougan
1999-01-15  1:38         ` Alan Cox
1999-01-15  8:26         ` Jesper Skov
1999-01-15  1:57       ` Paul Mackerras
1999-01-15  8:40         ` Jes Sorensen
1999-01-15 16:10         ` Alan Cox
1999-01-15 19:28           ` Cort Dougan
1999-01-16  1:00           ` Douglas Godfrey
1999-01-16  1:09             ` Synchronization [was Re: The Magic Show: kernel_map() Alan Cox
1999-01-15  8:50 Synchronization [was Re: The Magic Show: kernel_map() disappearing] 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=d390f69o12.fsf@valhall.cern.ch \
    --to=jes.sorensen@cern.ch \
    --cc=alan@cymru.net \
    --cc=cort@persephone.cs.nmt.edu \
    --cc=jskov@cygnus.co.uk \
    --cc=linux-apus@sunsite.auc.dk \
    --cc=linuxppc-dev@lists.linuxppc.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;
as well as URLs for NNTP newsgroup(s).