From: Jean-Francois Dagenais <jeff.dagenais@gmail.com>
To: linux-mm@kvack.org
Subject: use of alloc_bootmem for a PCI-e device
Date: Wed, 23 Nov 2011 14:30:30 -0500 [thread overview]
Message-ID: <9AF7658D-FEDB-479A-8D4F-A54264363CB4@gmail.com> (raw)
Hello fellow hackers,
I am maintaining a kernel for an embedded product. We have an FPGA
acquisition device interfaced through PCI-e on different intel platforms.
The acquisition device needs an extra large physically contiguous memory
area to autonomously dump acquired data into.
In a previous product, VT-d was available and I made use of it to allocate
128MB+ using vmalloc, then mapping it so it forms a contiguous address
chunk from the device side.
We are doing another incarnation of the product on an Atom E6xx which has
no such IOMMU and am looking into ways of allocating a huge chunk of ram.
Kind of like integrated gfx chips do with RAM, but I don't have the assistance
of the BIOS.
Based on suggestions to try using alloc_bootmem, I have started looking into
it by first making a platform (under arch/x86/platform) built-in module using
"pure_initcall" to get an early hook to allocate this memory. This approach
failed because the call would happen after SLUB init.
I then proceeded to hack "mm_init()" in init/main.c so that I do the alloc_bootmem
call after "mem_init()" but before "kmem_cache_init()". I successfully get the huge
chunk I request, and test that it is really physically contiguous.
My joy was not long lived, it was too easy. Once fully booted, I load a module
which tests a patter I wrote in memory to see if the memory got touched since
the early init moment, and it did. A crude test, but right away tells me the
allocation was not respected.
Any thoughts on how to achieve this?
We are targeting v3.1 64 or 32 bits, testing with 3.2-rc1 on x84_64. I noticed this
means "nobootmem.c" is used.
Thanks
/jfd
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next reply other threads:[~2011-11-23 19:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-23 19:30 Jean-Francois Dagenais [this message]
2011-11-23 19:31 ` Michal Nazarewicz
2011-11-23 21:21 ` Jean-Francois Dagenais
2011-11-23 21:31 ` Michal Nazarewicz
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=9AF7658D-FEDB-479A-8D4F-A54264363CB4@gmail.com \
--to=jeff.dagenais@gmail.com \
--cc=linux-mm@kvack.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