From: Ralf Baechle <ralf@linux-mips.org>
To: David Chau <dchau@mazunetworks.com>
Cc: linux-mips@linux-mips.org
Subject: Re: Why is mmap()ed reserved memory so slow?
Date: Mon, 18 Jul 2005 06:51:47 -0400 [thread overview]
Message-ID: <20050718105147.GA12254@linux-mips.org> (raw)
In-Reply-To: <42D836F8.8030209@mazunetworks.com>
On Fri, Jul 15, 2005 at 06:21:44PM -0400, David Chau wrote:
> I'm working on a driver for the Broadcom 1250, and I am using reserved
> memory for some data buffers. The board comes with 256 MB of RAM, so I
> boot Linux with "mem=253M" to reserve some RAM at the top of memory, and
> then mmap() /dev/mem starting at 253 MB.
>
> The problem is that accessing this memory is ridiculously slow. A simple
> benchmark revealed that it takes about 200 cycles to read a 64-bit
> number.
mmap will create uncached mappings for anything above the highest RAM
address.
> If I mmap() /dev/zero instead, a read takes under 3 cycles.
Because you have a cache hits. No RAM is that fast.
Above 200 cycles really is how horribly slow RAM is compared to a moderatly
clocked system.
> For those of you who knows how the Linux VM works, could you tell me why
> the memory access is so slow? It look like it might be invoking the
> page-fault handler on every read. How can I make memory access faster?
Ralf
prev parent reply other threads:[~2005-07-19 13:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-15 22:21 Why is mmap()ed reserved memory so slow? David Chau
2005-07-15 22:35 ` Dan Malek
2005-07-18 14:44 ` David Chau
2005-07-18 10:51 ` Ralf Baechle [this message]
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=20050718105147.GA12254@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=dchau@mazunetworks.com \
--cc=linux-mips@linux-mips.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