msm: kgsl: Directly return page size of the supported pool
In current code, if a request comes to allocate a page of a size for which pool is not supported EAGAIN is returned with a page size of PAGE_SIZE << --order. This is not efficient as it results in multiple retries in case pool of size = PAGE_SIZE << --order is also not supported. Instead of retrying with lower order page in a sequential manner this change directly returns the page size of the pool that is supported. Change-Id: Ib82ae5be7e4109fdc0a3d72bcbcd4b47cfb2e266 Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
This commit is contained in:
parent
9725c4d90b
commit
e8adb4c2b8
1 changed files with 12 additions and 1 deletions
|
@ -280,6 +280,17 @@ static int kgsl_pool_idx_lookup(unsigned int order)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int kgsl_pool_get_retry_order(unsigned int order)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = kgsl_num_pools-1; i > 0; i--)
|
||||||
|
if (order >= kgsl_pools[i].pool_order)
|
||||||
|
return kgsl_pools[i].pool_order;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* kgsl_pool_alloc_page() - Allocate a page of requested size
|
* kgsl_pool_alloc_page() - Allocate a page of requested size
|
||||||
* @page_size: Size of the page to be allocated
|
* @page_size: Size of the page to be allocated
|
||||||
|
@ -326,7 +337,7 @@ int kgsl_pool_alloc_page(int *page_size, struct page **pages,
|
||||||
if (pool == NULL) {
|
if (pool == NULL) {
|
||||||
/* Retry with lower order pages */
|
/* Retry with lower order pages */
|
||||||
if (order > 0) {
|
if (order > 0) {
|
||||||
size = PAGE_SIZE << --order;
|
size = PAGE_SIZE << kgsl_pool_get_retry_order(order);
|
||||||
goto eagain;
|
goto eagain;
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue