[RFC] Prohibit ioremap() on kernel managed RAM

Russell King - ARM Linux linux at arm.linux.org.uk
Sat May 1 05:19:43 EDT 2010


On Sat, May 01, 2010 at 11:54:55AM +0530, Shilimkar, Santosh wrote:
> This seems to be good solution if it's doable. Reserving memory in the boot
> is not so flexible and might end up in waste of memory.

However, allocating large pages (larger than 4K) is unreliable due to
fragmentation.  There's two factors here - the larger the allocation,
and the longer the system has been running, the more likely such an
allocation is to fail.

Since we'd need to enforce a minimum allocation size of 1MB in order to
unmap the direct mapping, we're asking for an order-8 page - and I think
you'll find that'll be fairly unreliable if you want to keep allocating
and freeing it.

The DMA allocators can handle anything up to MAX_ORDER-order allocations
provided it has enough virtual memory space available to it - so if you
want to go down this route, you might as well switch to using that.
(However, eventually the DMA allocator also needs fixing to avoid the
dual-mappings that it creates.)



More information about the linux-arm-kernel mailing list