public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Orjan Friberg <orjan.friberg@flatfrog.com>
To: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: copy_to_user speed from dma_alloc_coherent vs. kmalloc buffer
Date: Wed, 20 Apr 2011 17:12:48 +0200	[thread overview]
Message-ID: <4DAEF7F0.4080207@flatfrog.com> (raw)

Hi,

I have a driver where I do memory to memory DMA between GPMC and SDRAM. 
  Adding a read function, I found that copy_to_user from a 
dma_alloc_coherent buffer is significantly slower than from a kmalloc'd one.

Looking at arch/arm/include/asm/pgtable.h I suspect this difference in 
speed is due to the fact that the dma_alloc_coherent buffer is unbuffered.

What are my options (besides using mmap)?

* Reserve a portion of memory at boot time to be used as the DMA 
destination buffer, use ioremap_cached + manual cache flush as needed?
* Turn on buffering for the DMA destination buffer for the duration of 
the copy_to_user call, then turn it off again (and flush it from the cache)?
* Something else entirely?


This is on a 3730, on Linux 2.6.32.

Thanks,
Orjan

-- 
Orjan Friberg
FlatFrog Laboratories AB

             reply	other threads:[~2011-04-20 15:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-20 15:12 Orjan Friberg [this message]
2011-04-20 17:09 ` copy_to_user speed from dma_alloc_coherent vs. kmalloc buffer Orjan Friberg

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=4DAEF7F0.4080207@flatfrog.com \
    --to=orjan.friberg@flatfrog.com \
    --cc=linux-omap@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