From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: coherent memory should be ARMv6's Device Memory?
Date: Thu, 22 Oct 2009 22:18:33 +0100 [thread overview]
Message-ID: <1256246313.5076.12.camel@pc1117.cambridge.arm.com> (raw)
In-Reply-To: <EAF47CD23C76F840A9E7FCE10091EFAB02BB47FD79@dbde02.ent.ti.com>
On Thu, 2009-10-22 at 02:05 +0530, Shilimkar, Santosh wrote:
> > -----Original Message-----
> > From: linux-arm-kernel-bounces at lists.infradead.org [mailto:linux-
> > arm-kernel-bounces at lists.infradead.org] On Behalf Of
> > adharmap at codeaurora.org
> > Sent: Thursday, October 22, 2009 1:20 AM
> > To: linux-arm-kernel at lists.infradead.org
> > Subject: coherent memory should be ARMv6's Device Memory?
> >
> > The current implementation of __dma_alloc on ARMv7 based cpu
> > returns
> > Strongly Ordered Memory. On my uniprocessor hardware the strongly
> > ordered
> > memory causes the reads after a DMA_FROM_DEVICE transfer to be slow.
> > I
> > think __dma_alloc returns StronglyOrdered memory on all v6 and v7
> > variants
> > where arch_is_coherent is false.
> >
> > In my opinion, coherent memory should be changed from Strongly
> > Ordered
> > Memory to device memory for the following reasons
> > 1. Device and Strongly Ordered are both non-cacheable and hence
> > shareable
> > and coherent.
> > 2. There are no speculative fetches from Device and StronglyOrdered
> > 3. The Program order is guaranteed for access to Device and Strongly
> > Order
> > memory
> > 4. Device accesses don't insert a "dmb" after each accesses and
> > hence are
> > faster
> >
> > I am thinking of changing the pgprot_uncached to pgprot_device in
> > dma_alloc_coherent in dma-mapping.c.
>
> Just think about the DMA usage where DMA don't see the same copy in
> the memory because some data is still there in the Write buffer. This
> means which such a memory you always need to have DWB / DSB to ensure
> that your DMA sees correct copy. Effectively you are taking away the
> buffering advantage because DMA needs it that way.
It depends on the amount of data you write, the CPU may optimise
accesses to device or normal uncached memory much better than SO memory
(which looks pretty much like having a DSB after every access).
--
Catalin
next prev parent reply other threads:[~2009-10-22 21:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-21 19:50 coherent memory should be ARMv6's Device Memory? adharmap at codeaurora.org
2009-10-21 20:35 ` Shilimkar, Santosh
2009-10-22 21:18 ` Catalin Marinas [this message]
2009-10-22 21:12 ` Catalin Marinas
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=1256246313.5076.12.camel@pc1117.cambridge.arm.com \
--to=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.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).