summaryrefslogtreecommitdiffstats
path: root/drivers/staging/android/ion/ion_heap.c
diff options
context:
space:
mode:
authorRebecca Schultz Zavin <rebecca@android.com>2013-12-13 14:24:45 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-14 08:57:17 -0800
commitc13bd1c4eb714c08214e897fcbe51b13e0e0f279 (patch)
tree471b60bb44863c045e0252c44a5cf22c66e5f7d9 /drivers/staging/android/ion/ion_heap.c
parent349c9e13855109df99c5205a4e8d53d9fa169490 (diff)
downloadop-kernel-dev-c13bd1c4eb714c08214e897fcbe51b13e0e0f279.zip
op-kernel-dev-c13bd1c4eb714c08214e897fcbe51b13e0e0f279.tar.gz
gpu: ion: Fix performance issue in faulting code
Previously the code to fault ion buffers in one page at a time had a performance problem caused by the requirement to traverse the sg list looking for the right page to load in (a result of the fact that the items in the list may not be of uniform size). To fix the problem, for buffers that will be faulted in, also keep a flat array of all the pages in the buffer to use from the fault handler. To recover some of the additional memory footprint this creates per buffer, dirty bits used to indicate which pages have been faulted in to the cpu are now stored in the low bit of each page struct pointer in the page array. Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com> [jstultz: modified patch to apply to staging directory] Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/android/ion/ion_heap.c')
-rw-r--r--drivers/staging/android/ion/ion_heap.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/staging/android/ion/ion_heap.c b/drivers/staging/android/ion/ion_heap.c
index 3fc1dcc..cc2a425 100644
--- a/drivers/staging/android/ion/ion_heap.c
+++ b/drivers/staging/android/ion/ion_heap.c
@@ -134,8 +134,22 @@ end:
return ret;
}
-void ion_heap_free_page(struct ion_buffer *buffer, struct page *page,
- unsigned int order)
+struct page *ion_heap_alloc_pages(struct ion_buffer *buffer, gfp_t gfp_flags,
+ unsigned int order)
+{
+ struct page *page = alloc_pages(gfp_flags, order);
+
+ if (!page)
+ return page;
+
+ if (ion_buffer_fault_user_mappings(buffer))
+ split_page(page, order);
+
+ return page;
+}
+
+void ion_heap_free_pages(struct ion_buffer *buffer, struct page *page,
+ unsigned int order)
{
int i;
OpenPOWER on IntegriCloud