From: Scott Wood <scottwood@freescale.com>
To: <steven.lin@teradyne.com>
Cc: linuxppc-dev@lists.ozlabs.org,
David Gibson <david@gibson.dropbear.id.au>
Subject: Re: application needs fast access to physical memory
Date: Thu, 18 Nov 2010 13:35:49 -0600 [thread overview]
Message-ID: <20101118133549.1c6d2cc3@udp111988uds.am.freescale.net> (raw)
In-Reply-To: <OF313AFE4A.0F7F91F0-ON882577DF.0057B647-862577DF.005CF920@notes.teradyne.com>
On Thu, 18 Nov 2010 10:55:21 -0600
<steven.lin@teradyne.com> wrote:
> Thanks for the replies.
>=20
> In the Linux Device Drivers book regarding mmap(), it states:
>=20
> Mapping a device means associating a range of user-space addresses to
> device memory.
> Whenever the program reads or writes in the assigned address range, it
> is actually
> accessing the device. In the X server example, using mmap allows quick
> and easy
> access to the video card=E2=80=99s memory. For a performance-critical
> application like this,
> direct access makes a large difference.
>=20
> For whatever reason, mmap() is definitely not quick and does not appear to
> be a direct access to device memory. After the application completes a
> large write into physical memory (via the pointer returned from mmap()),
> the application performs an ioctl() to query whether the data actually
> arrived into the memory region. It seems to take some time before the
> associated kernel module actually "sees" the data in the physical memory
> region.
>=20
> There's a few things I should say about this memory region. There's a tot=
al
> of 512 MB of physical memory. U-Boot passes "mem=3D256M" as a kernel
> parameter to tell Linux to only directly manage the lower 256 MB. The
> special region of physical memory that the application is trying to access
> is the upper 256 MB of memory not directly managed by Linux. The mmap()
> call from the application is:
> *memptr =3D (void *) mmap( NULL, size, PROT_READ | PROT_WRITE, MAP_SHA=
RED,
> _fdTerAlloc, (off_t) 0x10000000);
Try this patch:
http://patchwork.ozlabs.org/patch/68246/
-Scott
next prev parent reply other threads:[~2010-11-18 19:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-17 22:03 application needs fast access to physical memory steven.lin
2010-11-18 12:24 ` Michael Ellerman
2010-11-18 12:52 ` David Laight
2010-11-18 12:54 ` David Gibson
2010-11-18 16:55 ` steven.lin
2010-11-18 19:35 ` Scott Wood [this message]
2010-11-18 20:46 ` steven.lin
2010-11-18 20:48 ` Scott Wood
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=20101118133549.1c6d2cc3@udp111988uds.am.freescale.net \
--to=scottwood@freescale.com \
--cc=david@gibson.dropbear.id.au \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=steven.lin@teradyne.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