powerpc: rework dma-noncoherent to use generic vmalloc layer (2nd rev)
PATCH 1/1 powerpc: rework dma-noncoherent to use generic vmalloc layer (2nd rev)
This patch rewrites consistent dma allocations support to use vmalloc layer to allocate virtual memory space from vmalloc pool and get rid of CONFIG_CONSISTENT_{START,SIZE}.
I still use VM_IOREMAP flag for these allocations (I'll try to post patch adding separate VM_COHERENT_DMA flag to lkml later). Now I save pages array in vm_struct pages field and use __builtin_return_address(1) as 'caller' argument to get usefull info in /proc/vmallocinfo:
-bash-3.2# cat /proc/vmallocinfo
0xe1000000-0xe1002000 8192 __ioremap+0x184/0x194 ioremap
[...]
0xe1f90000-0xe1f96000 24576 PrimeIocFifos+0x3a8/0x550 pages=5 ioremap 0xe1fa0000-0xe1fb1000 69632 __ioremap+0x184/0x194 ioremap 0xe1fc0000-0xe1fd1000 69632 __ioremap+0x184/0x194 ioremap
0xe2000000-0xe2f01000 15732736 __ioremap+0x184/0x194 ioremap
0xe2f32000-0xe2f34000 8192 __ioremap+0x184/0x194 ioremap
0xe2f38000-0xe2f3d000 20480 __ioremap+0x184/0x194 ioremap
0xe2f40000-0xe2f46000 24576 PrimeIocFifos+0x3a8/0x550 pages=5 ioremap
0xe2f80000-0xe3e81000 15732736 __ioremap+0x184/0x194 ioremap 0xe3f00000-0xe3f48000 294912 PrimeIocFifos+0x204/0x550 pages=71 ioremap 0xe3f80000-0xe3fc8000 294912 PrimeIocFifos+0x204/0x550 pages=71 ioremap
0xe3fe0000-0xe3fe6000 24576 bdx_fifo_init+0x8c/0x12c pages=5 ioremap 0xe3fe8000-0xe3fee000 24576 bdx_fifo_init+0x8c/0x12c pages=5 ioremap 0xe3fef000-0xe3ff8000 36864 bdx_open+0x10c/0x60c pages=8 vmalloc 0xe4000000-0xe4006000 24576 bdx_fifo_init+0x8c/0x12c pages=5 ioremap 0xe4007000-0xe400f000 32768 bdx_open+0x1f0/0x60c pages=7 vmalloc 0xe4010000-0xe401a000 40960 bdx_fifo_init+0x8c/0x12c pages=9 ioremap
(those ioremaps with pages=)
--- arch/powerpc/Kconfig | 25 --- arch/powerpc/lib/dma-noncoherent.c | 299 +++++++----------------------------- 2 files changed, 53 insertions(+), 271 deletions(-)
arch/powerpc/Kconfig +0 -25
@@ -815,31 +815,6 @@ config TASK_SIZE default "0x80000000" if PPC_PREP || PPC_8xx default "0xc0000000" -config CONSISTENT_START_BOOL - bool "Set custom consistent memory pool address" - depends on ADVANCED_OPTIONS && NOT_COHERENT_CACHE - help - This option allows you to set the base virtual address - of the consistent memory pool. This pool of virtual - memory is used to make consistent memory allocations. - -config CONSISTENT_START - hex "Base virtual address of consistent memory pool" if CONSISTENT_START_BOOL - default "0xfd000000" if (NOT_COHERENT_CACHE && 8xx) - default "0xff100000" if NOT_COHERENT_CACHE - -config CONSISTENT_SIZE_BOOL - bool "Set custom consistent memory pool size" - depends on ADVANCED_OPTIONS && NOT_COHERENT_CACHE - help - This option allows you to set the size of the - consistent memory pool. This pool of virtual memory - is used to make consistent memory allocations. - -config CONSISTENT_SIZE - hex "Size of consistent memory pool" if CONSISTENT_SIZE_BOOL - default "0x00200000" if NOT_COHERENT_CACHE - config PIN_TLB bool "Pinned Kernel TLBs (860 ONLY)" depends on ADVANCED_OPTIONS && 8xx
arch/powerpc/lib/dma-noncoherent.c +53 -246
353 lines not on this page · raw message
Signature · 1 line
1.6.0.6
PATCH 1/1 powerpc: rework dma-noncoherent to use generic vmalloc layer (3rd rev)
This patch rewrites consistent dma allocations support to use vmalloc layer to allocate virtual memory space from vmalloc pool and get rid of CONFIG_CONSISTENT_{START,SIZE}.
I still use VM_IOREMAP flag for these allocations (I'll try to post patch adding separate VM_COHERENT_DMA flag to lkml later). Now I save pages array in vm_struct pages field and use __builtin_return_address(1) as 'caller' argument to get usefull info in /proc/vmallocinfo:
-bash-3.2# cat /proc/vmallocinfo
0xe1000000-0xe1002000 8192 __ioremap+0x184/0x194 ioremap
[...]
0xe1f90000-0xe1f96000 24576 PrimeIocFifos+0x3a8/0x550 pages=5 ioremap 0xe1fa0000-0xe1fb1000 69632 __ioremap+0x184/0x194 ioremap 0xe1fc0000-0xe1fd1000 69632 __ioremap+0x184/0x194 ioremap
0xe2000000-0xe2f01000 15732736 __ioremap+0x184/0x194 ioremap
0xe2f32000-0xe2f34000 8192 __ioremap+0x184/0x194 ioremap
0xe2f38000-0xe2f3d000 20480 __ioremap+0x184/0x194 ioremap
0xe2f40000-0xe2f46000 24576 PrimeIocFifos+0x3a8/0x550 pages=5 ioremap
0xe2f80000-0xe3e81000 15732736 __ioremap+0x184/0x194 ioremap 0xe3f00000-0xe3f48000 294912 PrimeIocFifos+0x204/0x550 pages=71 ioremap 0xe3f80000-0xe3fc8000 294912 PrimeIocFifos+0x204/0x550 pages=71 ioremap
0xe3fe0000-0xe3fe6000 24576 bdx_fifo_init+0x8c/0x12c pages=5 ioremap 0xe3fe8000-0xe3fee000 24576 bdx_fifo_init+0x8c/0x12c pages=5 ioremap 0xe3fef000-0xe3ff8000 36864 bdx_open+0x10c/0x60c pages=8 vmalloc 0xe4000000-0xe4006000 24576 bdx_fifo_init+0x8c/0x12c pages=5 ioremap 0xe4007000-0xe400f000 32768 bdx_open+0x1f0/0x60c pages=7 vmalloc 0xe4010000-0xe401a000 40960 bdx_fifo_init+0x8c/0x12c pages=9 ioremap
(those ioremaps with pages=)
---
Previous version had a memory leak in error code path.
--- arch/powerpc/Kconfig | 25 --- arch/powerpc/lib/dma-noncoherent.c | 303 +++++++----------------------------- 2 files changed, 57 insertions(+), 271 deletions(-)
arch/powerpc/Kconfig +0 -25
@@ -815,31 +815,6 @@ config TASK_SIZE default "0x80000000" if PPC_PREP || PPC_8xx default "0xc0000000" -config CONSISTENT_START_BOOL - bool "Set custom consistent memory pool address" - depends on ADVANCED_OPTIONS && NOT_COHERENT_CACHE - help - This option allows you to set the base virtual address - of the consistent memory pool. This pool of virtual - memory is used to make consistent memory allocations. - -config CONSISTENT_START - hex "Base virtual address of consistent memory pool" if CONSISTENT_START_BOOL - default "0xfd000000" if (NOT_COHERENT_CACHE && 8xx) - default "0xff100000" if NOT_COHERENT_CACHE - -config CONSISTENT_SIZE_BOOL - bool "Set custom consistent memory pool size" - depends on ADVANCED_OPTIONS && NOT_COHERENT_CACHE - help - This option allows you to set the size of the - consistent memory pool. This pool of virtual memory - is used to make consistent memory allocations. - -config CONSISTENT_SIZE - hex "Size of consistent memory pool" if CONSISTENT_SIZE_BOOL - default "0x00200000" if NOT_COHERENT_CACHE - config PIN_TLB bool "Pinned Kernel TLBs (860 ONLY)" depends on ADVANCED_OPTIONS && 8xx
arch/powerpc/lib/dma-noncoherent.c +57 -246
357 lines not on this page · raw message
Signature · 1 line
1.6.0.6