summaryrefslogtreecommitdiff
path: root/drivers/gpu/ion/ion_heap.c
diff options
context:
space:
mode:
authorRebecca Schultz Zavin <rebecca@android.com>2013-06-12 15:22:16 -0700
committerColin Cross <ccross@android.com>2013-09-19 13:50:13 -0500
commitbbf5538ee0e4c30ba9b4556f9699ed5f31df67da (patch)
tree09468f71dd29ce2f392e4f527f0c25db2c03f2fe /drivers/gpu/ion/ion_heap.c
parentae2b22e9b7a207d9392df5b5ec93b8c042d4b3ce (diff)
downloadolio-linux-3.10-bbf5538ee0e4c30ba9b4556f9699ed5f31df67da.tar.xz
olio-linux-3.10-bbf5538ee0e4c30ba9b4556f9699ed5f31df67da.zip
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. Change-Id: I891b077dc0c88ed6d416b256626d8778fd67be84 Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Diffstat (limited to 'drivers/gpu/ion/ion_heap.c')
-rw-r--r--drivers/gpu/ion/ion_heap.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/gpu/ion/ion_heap.c b/drivers/gpu/ion/ion_heap.c
index 05e7ce5499c..bf6a383bd98 100644
--- a/drivers/gpu/ion/ion_heap.c
+++ b/drivers/gpu/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;