public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: akepner@sgi.com
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	grundler@parisc-linux.org, jbarnes@virtuousgeek.org, jes@sgi.com,
	randy.dunlap@oracle.com, rdreier@cisco.com,
	James.Bottomley@steeleye.com, davem@davemloft.net,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC] dma: passing "attributes" to dma_map_* routines
Date: Fri, 21 Dec 2007 21:24:25 +0100	[thread overview]
Message-ID: <476C20F9.1@s5r6.in-berlin.de> (raw)
In-Reply-To: <20071221180022.GW412@sgi.com>

akepner@sgi.com wrote:
> On Fri, Dec 21, 2007 at 07:56:25AM +1100, Benjamin Herrenschmidt wrote:
>> ...
>> Can't you just have a primitive to sync things up that you call
>> explicitely from your driver after fetching a new status entry ?
> 
> Well, the only mechanisms I know to get things synced are the ones 
> I mentioned before: 1) generate an interrupt, 2) write to memory 
> which has the "barrier" attribute. Obviously 1 is out - giving  
> the memory used for status indications the barrier attribute is 
> the most primitive means I'm aware of.

I don't know what it is in detail what Arthur et al are facing, but this
is how it looks to me:

A sync call like Benjamin suggests has two preconditions.

  1. The interconnect hardware actually offers such a functionality.
I.e. there is a way for the CPU to request flushing of pending DMAs, and
the interconnect is able to generate an interrupt to signal when it is done.

  2. The protocols which the devices use are suitable for this.  I.e.
 there are no race conditions during the window between when the DMAs
were flushed and when the CPU has finished reading the status memory area.

Even _if_ both is true, a regime with such a call would obviously be
more complex and might be harder to get to perform well, compared to the
regime where the interconnect hardware is told beforehand that some
particular DMA writes must never be reordered relative to earlier and
later DMA writes.
-- 
Stefan Richter
-=====-=-=== ==-- =-=-=
http://arcgraph.de/sr/

  reply	other threads:[~2007-12-21 20:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-18  0:17 [RFC] dma: passing "attributes" to dma_map_* routines akepner
2007-12-18 16:50 ` Stefan Richter
2007-12-18 19:04   ` Roland Dreier
2007-12-18 20:07   ` akepner
2007-12-18 20:59     ` Stefan Richter
2007-12-18 21:09       ` Roland Dreier
2007-12-20 18:51       ` akepner
2007-12-20 19:06       ` akepner
2007-12-20 20:56     ` Benjamin Herrenschmidt
2007-12-21 18:00       ` akepner
2007-12-21 20:24         ` Stefan Richter [this message]
2007-12-21 21:31         ` 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=476C20F9.1@s5r6.in-berlin.de \
    --to=stefanr@s5r6.in-berlin.de \
    --cc=James.Bottomley@steeleye.com \
    --cc=akepner@sgi.com \
    --cc=akpm@linux-foundation.org \
    --cc=benh@kernel.crashing.org \
    --cc=davem@davemloft.net \
    --cc=grundler@parisc-linux.org \
    --cc=jbarnes@virtuousgeek.org \
    --cc=jes@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=randy.dunlap@oracle.com \
    --cc=rdreier@cisco.com \
    /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