CMA reservations have different result in linux 4.1.5 kernel compared to linux 3.14 kernel.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi laurent.pinchart,

 

I found there is a commit to reserve CMA from high memory first and then falls back to low memory.

 

commit 16195ddd4ebcc10c30b2f232f8e400df8d464380

Author: Laurent Pinchart <laurent.pinchart+renesas@xxxxxxxxxxxxxxxx>

Date:   Fri Oct 24 13:18:41 2014 +0300

 

    mm: cma: Ensure that reservations never cross the low/high mem boundary

 

    Commit 95b0e655f914 ("ARM: mm: don't limit default CMA region only to

    low memory") extended CMA memory reservation to allow usage of high

    memory. It relied on commit f7426b983a6a ("mm: cma: adjust address limit

    to avoid hitting low/high memory boundary") to ensure that the reserved

    block never crossed the low/high memory boundary. While the

    implementation correctly lowered the limit, it failed to consider the

    case where the base..limit range crossed the low/high memory boundary

    with enough space on each side to reserve the requested size on either

    low or high memory.

 

    Rework the base and limit adjustment to fix the problem. The function

    now starts by rejecting the reservation altogether for fixed

    reservations that cross the boundary, tries to reserve from high memory

    first and then falls back to low memory.

 

The CMA configuration has two paths. One is in DTS and the other in kernel command line.

In order to make convenient to adjust CMA size, we use kernel command line to set CMA size in linux 3.14 kernel.

When the kernel is upgraded from 3.14 to 4.1, there is an strange issue.

The CMA reserved base address is changed from low memory to high memory.

Of course it introduces a lot of issues on our imx6 platform when CMA reserved base address is at high memory.

So, I find your commit listed above that change the CMA reserved base address.

Of course this change itself doesn't have any problem.

But it has different result compared to configuring CMA in DTS.

The CMA reserved base address is at low memory when configure CMA in DTS.

 

My questions are:

1. the two CMA configuration methods reside in different memory zone which may introduce confusion.

2. This commit breaks the kernel backward compatibility that the same CMA configuration in old kernel version should reside in the same memory zone when kernel upgrade.

 

There is one patch attached to make CMA reserved memory allocating from low memory firstly and fall back to high memory to be backward compatible.

If the CMA is required to be reserved at high memory, the CMA base should be set to configure CMA memory.

 

Best Regards,

Ivan.liu

 

 

Attachment: 0001-correct-CMA-reserved-memory-allocating-from-low-memo.patch
Description: 0001-correct-CMA-reserved-memory-allocating-from-low-memo.patch


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]