Commit bdeb9f1c authored by Heesub Shin's avatar Heesub Shin Committed by Greg Kroah-Hartman

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: default avatarHeesub Shin <heesub.shin@samsung.com>
Reviewed-by: default avatarMitchel Humpherys <mitchelh@codeaurora.org>
Tested-by: default avatarJohn Stultz <john.stultz@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 38c003b1
...@@ -95,6 +95,8 @@ void ion_page_pool_free(struct ion_page_pool *pool, struct page *page) ...@@ -95,6 +95,8 @@ void ion_page_pool_free(struct ion_page_pool *pool, struct page *page)
{ {
int ret; int ret;
BUG_ON(pool->order != compound_order(page));
ret = ion_page_pool_add(pool, page); ret = ion_page_pool_add(pool, page);
if (ret) if (ret)
ion_page_pool_free_pages(pool, page); 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,7 +152,7 @@ struct ion_page_pool *ion_page_pool_create(gfp_t gfp_mask, unsigned int order)
pool->low_count = 0; pool->low_count = 0;
INIT_LIST_HEAD(&pool->low_items); INIT_LIST_HEAD(&pool->low_items);
INIT_LIST_HEAD(&pool->high_items); INIT_LIST_HEAD(&pool->high_items);
pool->gfp_mask = gfp_mask; pool->gfp_mask = gfp_mask | __GFP_COMP;
pool->order = order; pool->order = order;
mutex_init(&pool->mutex); mutex_init(&pool->mutex);
plist_node_init(&pool->list, order); plist_node_init(&pool->list, order);
......
...@@ -73,7 +73,7 @@ static struct page *alloc_buffer_page(struct ion_system_heap *heap, ...@@ -73,7 +73,7 @@ static struct page *alloc_buffer_page(struct ion_system_heap *heap,
if (order > 4) if (order > 4)
gfp_flags = high_order_gfp_flags; gfp_flags = high_order_gfp_flags;
page = alloc_pages(gfp_flags, order); page = alloc_pages(gfp_flags | __GFP_COMP, order);
if (!page) if (!page)
return NULL; return NULL;
ion_pages_sync_for_device(NULL, page, PAGE_SIZE << order, ion_pages_sync_for_device(NULL, page, PAGE_SIZE << order,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment