Skip to content
  • Marek Szyprowski's avatar
    mm: cma: adjust address limit to avoid hitting low/high memory boundary · f7426b98
    Marek Szyprowski authored
    Russell King recently noticed that limiting default CMA region only to low
    memory on ARM architecture causes serious memory management issues with
    machines having a lot of memory (which is mainly available as high
    memory).  More information can be found the following thread:
    http://thread.gmane.org/gmane.linux.ports.arm.kernel/348441/
    
    
    
    Those two patches removes this limit letting kernel to put default CMA
    region into high memory when this is possible (there is enough high memory
    available and architecture specific DMA limit fits).
    
    This should solve strange OOM issues on systems with lots of RAM (i.e.
    >1GiB) and large (>256M) CMA area.
    
    This patch (of 2):
    
    Automatically allocated regions should not cross low/high memory boundary,
    because such regions cannot be later correctly initialized due to spanning
    across two memory zones.  This patch adds a check for this case and a
    simple code for moving region to low memory if automatically selected
    address might not fit completely into high memory.
    
    Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
    Acked-by: default avatarMichal Nazarewicz <mina86@mina86.com>
    Cc: Daniel Drake <drake@endlessm.com>
    Cc: Minchan Kim <minchan@kernel.org>
    Cc: Russell King <rmk@arm.linux.org.uk>
    Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    f7426b98