diff options
author | Heesub Shin <heesub.shin@samsung.com> | 2014-05-28 02:52:55 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-29 16:40:33 -0400 |
commit | bdeb9f1c4276864e97a725c8c0a8bc9a8686edfe (patch) | |
tree | 7dff4d4093976d892e40e9cd12a3ba8441e3c865 | |
parent | 38c003b113ceab37f80d020999d3ec2cbf784da3 (diff) |
staging: ion: use compound pages on high order pages for system heap
Using compound pages relieves burden on tracking the meta information
which are currently stored in page_info.
Signed-off-by: Heesub Shin <heesub.shin@samsung.com>
Reviewed-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Tested-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/android/ion/ion_page_pool.c | 4 | ||||
-rw-r--r-- | drivers/staging/android/ion/ion_system_heap.c | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/android/ion/ion_page_pool.c b/drivers/staging/android/ion/ion_page_pool.c index 111777c6e25a..c1cea42b0510 100644 --- a/drivers/staging/android/ion/ion_page_pool.c +++ b/drivers/staging/android/ion/ion_page_pool.c | |||
@@ -95,6 +95,8 @@ void ion_page_pool_free(struct ion_page_pool *pool, struct page *page) | |||
95 | { | 95 | { |
96 | int ret; | 96 | int ret; |
97 | 97 | ||
98 | BUG_ON(pool->order != compound_order(page)); | ||
99 | |||
98 | ret = ion_page_pool_add(pool, page); | 100 | ret = ion_page_pool_add(pool, page); |
99 | if (ret) | 101 | if (ret) |
100 | ion_page_pool_free_pages(pool, page); | 102 | ion_page_pool_free_pages(pool, page); |
@@ -150,7 +152,7 @@ struct ion_page_pool *ion_page_pool_create(gfp_t gfp_mask, unsigned int order) | |||
150 | pool->low_count = 0; | 152 | pool->low_count = 0; |
151 | INIT_LIST_HEAD(&pool->low_items); | 153 | INIT_LIST_HEAD(&pool->low_items); |
152 | INIT_LIST_HEAD(&pool->high_items); | 154 | INIT_LIST_HEAD(&pool->high_items); |
153 | pool->gfp_mask = gfp_mask; | 155 | pool->gfp_mask = gfp_mask | __GFP_COMP; |
154 | pool->order = order; | 156 | pool->order = order; |
155 | mutex_init(&pool->mutex); | 157 | mutex_init(&pool->mutex); |
156 | plist_node_init(&pool->list, order); | 158 | plist_node_init(&pool->list, order); |
diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c index ae3c9ed59b09..cb7ae08a5e24 100644 --- a/drivers/staging/android/ion/ion_system_heap.c +++ b/drivers/staging/android/ion/ion_system_heap.c | |||
@@ -73,7 +73,7 @@ static struct page *alloc_buffer_page(struct ion_system_heap *heap, | |||
73 | 73 | ||
74 | if (order > 4) | 74 | if (order > 4) |
75 | gfp_flags = high_order_gfp_flags; | 75 | gfp_flags = high_order_gfp_flags; |
76 | page = alloc_pages(gfp_flags, order); | 76 | page = alloc_pages(gfp_flags | __GFP_COMP, order); |
77 | if (!page) | 77 | if (!page) |
78 | return NULL; | 78 | return NULL; |
79 | ion_pages_sync_for_device(NULL, page, PAGE_SIZE << order, | 79 | ion_pages_sync_for_device(NULL, page, PAGE_SIZE << order, |