diff options
author | Colin Cross <ccross@android.com> | 2013-11-21 18:56:37 -0800 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2013-12-12 15:27:09 -0800 |
commit | b928ad649cd32b4ca5ba7429bfe897433d37dfea (patch) | |
tree | b4aed7f7e75f68a3039f1dce8a0f2a9a3c628d5f | |
parent | fc04e484c319b8df647886d4cf17f7c450453d1d (diff) |
ion: free low memory from page pools first
When the shrinkers are called with GFP_HIGH free low memory first,
it is more important to have free than high memory.
Change-Id: I7ad8a9c133830f04d429c3d87b781b3e862ccedb
Signed-off-by: Colin Cross <ccross@android.com>
-rw-r--r-- | drivers/staging/android/ion/ion_page_pool.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/android/ion/ion_page_pool.c b/drivers/staging/android/ion/ion_page_pool.c index b052ff6bf38..5a0e629c188 100644 --- a/drivers/staging/android/ion/ion_page_pool.c +++ b/drivers/staging/android/ion/ion_page_pool.c @@ -143,10 +143,10 @@ int ion_page_pool_shrink(struct ion_page_pool *pool, gfp_t gfp_mask, struct page *page; mutex_lock(&pool->mutex); - if (high && pool->high_count) { - page = ion_page_pool_remove(pool, true); - } else if (pool->low_count) { + if (pool->low_count) { page = ion_page_pool_remove(pool, false); + } else if (high && pool->high_count) { + page = ion_page_pool_remove(pool, true); } else { mutex_unlock(&pool->mutex); break; |