Skip to content

Commit

Permalink
ion: free low memory from page pools first
Browse files Browse the repository at this point in the history
When the shrinkers are called with GFP_HIGH free low memory first,
it is more important to have free than high memory.

Signed-off-by: Colin Cross <[email protected]>
Signed-off-by: John Stultz <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
colincross authored and gregkh committed Dec 14, 2013
1 parent 8b312bb commit ce3d109
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/staging/android/ion/ion_page_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ce3d109

Please sign in to comment.