]> Pileus Git - ~andy/linux/commit
ion: optimize ion_heap_buffer_zero
authorColin Cross <ccross@android.com>
Sat, 14 Dec 2013 03:26:21 +0000 (19:26 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2013 16:59:53 +0000 (08:59 -0800)
commit8b312bb9a795c9c07661aee7b694cbfd3217e25c
tree1d4234db865517dd77fb3e5f30323887c973207d
parentf0f06763820e5b5f6e13afa814e68e8f4d955c45
ion: optimize ion_heap_buffer_zero

ion_heap_buffer_zero can spend a long time in unmap_kernel_range
if it has to broadcast a tlb flush to every cpu for every page.
Modify it to batch pages into a larger region to clear using a
single mapping.  This may cause the mapping size to change if
the buffer size is not a multiple of the mapping size, so
switch to allocating the address space for each chunk.  This
allows us to use vm_map_ram to handle the allocation and mapping
together.

The number of pages to zero using a single mapping is set to 32
to hit the fastpath in vm_map_ram.

Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/ion/ion_heap.c