linux-mips
[Top] [All Lists]

Re: Why is mmap()ed reserved memory so slow?

To: David Chau <dchau@mazunetworks.com>
Subject: Re: Why is mmap()ed reserved memory so slow?
From: Dan Malek <dan@embeddedalley.com>
Date: Fri, 15 Jul 2005 18:35:11 -0400
Cc: linux-mips@linux-mips.org
In-reply-to: <42D836F8.8030209@mazunetworks.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <42D836F8.8030209@mazunetworks.com>
Sender: linux-mips-bounce@linux-mips.org

On Jul 15, 2005, at 6:21 PM, David Chau wrote:

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?

How about a little more info, like what kernel are you using and what are
the parameters you are sending to mmap()?

One of the things that happens here is /dev/mem is thinking this memory is
not real memory (because you said the system has only 253M of real
memory), so it treats it like IO space. This causes changes to the attributes
of the pages, most notably the CCA type for cache or pipeline behavior,
which isn't what you want in this case.

The better way to approach this is to place an mmap() function in the
associated driver that works in conjunction with the application to gain
shared access as you expect.  This also closes a hole where an errant
application could write into unexpected places through /dev/mem.

Thanks.

        -- Dan


<Prev in Thread] Current Thread [Next in Thread>