ioremap and vmalloc
Benjamin Herrenschmidt
benh at kernel.crashing.org
Mon Sep 22 15:28:50 EST 2008
On Fri, 2008-09-19 at 18:45 +0200, Sébastien Chrétien wrote:
> if I write :
> ioremap(0x20000000,0x40000) and ioremap(0x20000000,0x50000)
>
> Will it crash ?
To give you a rough idea, unless you tweak things like TASK_SIZE,
KERNELBASE, CONFIG_LOWMEM_SIZE, etc... and depending on what CPU you
use, you can generally count on approx. 200M of virtual space for
vmalloc/ioremap, or a bit less. I would additionally recommend against
mapping a significant portion of that for your devices as the kernel
will need space for its own use by vmalloc.
You can increase the amount available here by lowering TASK_SIZE to 2G
and KERNELBASE as well, and keeping CONFIG_LOWMEM_SIZE clamped to
something like 256M. That will give you a good GB of virtual space if I
can still count correctly.
(Note, having just looked at the MMU init code for 32 bits, I almost had
to puke, Kumar, Josh, we really need to clean that shit up one of these
days).
Cheers,
Ben.
More information about the Linuxppc-dev
mailing list