Dear Linaro term:
this is my system status:
kernel version: 3.10 kernel/user space split: 1G/3G system memory: 2GB lowmem/vmalloc: 760MB/240MB CMA reverse: 512MB
If CMA is placed in the lowmem area, it is working fine; when i move it to high zone, it working abnomaly:
<1>[ 647.755598] Unhandled fault: imprecise external abort (0x1c06) at 0x76429000 <0>[ 647.755621] Internal error: : 1c06 [#1] PREEMPT SMP ARM <4>[ 647.755633] Modules linked in: <4>[ 647.755648] CPU: 1 PID: 162 Comm: Binder_1 Not tainted 3.10.0 #48 <4>[ 647.755676] task: d6ac3700 ti: c576e000 task.ti: c576e000 <4>[ 647.755700] PC is at __memzero+0x28/0x80 <4>[ 647.755710] LR is at 0x0 <4>[ 647.755720] pc : [<c0250fa8>] lr : [<00000000>] psr: 20030013 <4>[ 0.000000] sp : c576fdd4 ip : 00000000 fp : 00b40000 <4>[ 647.755742] r10: 00000000 r9 : c0c18000 r8 : bff87000 <4>[ 647.755755] r7 : 00b38000 r6 : c1490100 r5 : c1490000 r4 : 00b40000 <4>[ 647.755768] r3 : 00000000 r2 : 00000000 r1 : 00000e80 r0 : bff87150 <4>[ 647.755783] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user <4>[ 647.755799] Control: 10c5387d Table: 0560406a DAC: 00000015
On Monday 12 May 2014 16:01:26 albuer wrote:
Dear Linaro term:
this is my system status:
kernel version: 3.10 kernel/user space split: 1G/3G system memory: 2GB lowmem/vmalloc: 760MB/240MB CMA reverse: 512MB
If CMA is placed in the lowmem area, it is working fine; when i move it to high zone, it working abnomaly:
I'm pretty sure CMA in highmem was never implemented. It's not trivial, and it's questionable whether this would be a good idea. Why do you want to do this?
Arnd
Dear Arnd:
I need more than 512MB for CMA area in my system, such as 768MB, but lowmem only 760MB.
I try split kernel/user to 2G/2G, but some games run abnormal. :(
于 2014/5/12 18:12, Arnd Bergmann 写道:
On Monday 12 May 2014 16:01:26 albuer wrote:
Dear Linaro term:
this is my system status:
kernel version: 3.10 kernel/user space split: 1G/3G system memory: 2GB lowmem/vmalloc: 760MB/240MB CMA reverse: 512MB
If CMA is placed in the lowmem area, it is working fine; when i move it to high zone, it working abnomaly:
I'm pretty sure CMA in highmem was never implemented. It's not trivial, and it's questionable whether this would be a good idea. Why do you want to do this?
Arnd
On Monday 12 May 2014 18:32:14 albuer wrote:
Dear Arnd:
I need more than 512MB for CMA area in my system, such as 768MB, but lowmem only 760MB.
I try split kernel/user to 2G/2G, but some games run abnormal.
If you have 760MB Lowmem, you also only have 256MB of vmalloc area, so even if someone were to implement CMA in highmem, you would have no place to map it, so that is pointless.
Arnd
After I alloc the memory from CMA, i unmap it immediately, ensure the vmalloc area has enough place.
This memory is use for GPU/VPU/Camera etc. Not for ARM.
I have seen some information about CMA: "implement support for contiguous memory areas that are placed in HIGHMEM zone"
于 2014/5/12 18:34, Arnd Bergmann 写道:
On Monday 12 May 2014 18:32:14 albuer wrote:
Dear Arnd:
I need more than 512MB for CMA area in my system, such as 768MB, but lowmem only 760MB.
I try split kernel/user to 2G/2G, but some games run abnormal.
If you have 760MB Lowmem, you also only have 256MB of vmalloc area, so even if someone were to implement CMA in highmem, you would have no place to map it, so that is pointless.
Arnd
On Monday 12 May 2014 18:47:52 albuer wrote:
After I alloc the memory from CMA, i unmap it immediately, ensure the vmalloc area has enough place.
This memory is use for GPU/VPU/Camera etc. Not for ARM.
I have seen some information about CMA: "implement support for contiguous memory areas that are placed in HIGHMEM zone"
I see now that there is some level of support for it, at least the current version of __alloc_from_contiguous() checks for PageHighMem.
However, unmapping an area you got from dma_alloc_coherent() sounds like a really bad idea, that could screw up the memory management in all sorts of ways. What interface do you use to unmap it?
I suppose what you want here would be add a check for DMA_ATTR_NO_KERNEL_MAPPING in alloc_from_contiguous and then just unmap the pages there, rather than calling __dma_remap() or __dma_alloc_remap().
Arnd
I use __dma_free_remap() to unmap this area that come from dma_alloc_coherent().
According to your suggestion, i don't do map in __alloc_from_contiguous() , the test looks all right, i still need to do more tests, it takes about two days.
If the test can pass, may i submit the code to your kernel?
于 2014/5/12 19:24, Arnd Bergmann 写道:
On Monday 12 May 2014 18:47:52 albuer wrote:
After I alloc the memory from CMA, i unmap it immediately, ensure the vmalloc area has enough place.
This memory is use for GPU/VPU/Camera etc. Not for ARM.
I have seen some information about CMA: "implement support for contiguous memory areas that are placed in HIGHMEM zone"
I see now that there is some level of support for it, at least the current version of __alloc_from_contiguous() checks for PageHighMem.
However, unmapping an area you got from dma_alloc_coherent() sounds like a really bad idea, that could screw up the memory management in all sorts of ways. What interface do you use to unmap it?
I suppose what you want here would be add a check for DMA_ATTR_NO_KERNEL_MAPPING in alloc_from_contiguous and then just unmap the pages there, rather than calling __dma_remap() or __dma_alloc_remap().
Arnd
On Tuesday 13 May 2014 11:53:40 albuer wrote:
I use __dma_free_remap() to unmap this area that come from dma_alloc_coherent().
Ah, right. This probably fails when it gets unmapped again. It also seems you had to export this interface first, since in the upstream version it is marked 'static'.
According to your suggestion, i don't do map in __alloc_from_contiguous() , the test looks all right, i still need to do more tests, it takes about two days.
If the test can pass, may i submit the code to your kernel?
Please submit it for review to linux-arm-kernel@lists.infradead.org first, and put the people on Cc that are listed frequently in the git history for arch/arm/mm/dma-mapping.c. Russell will be the one to merge the patch once it's been reviewed successfully.
Arnd
linaro-kernel@lists.linaro.org