diff options
author | Colin Cross <ccross@android.com> | 2013-12-14 03:26:22 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-14 16:59:53 (GMT) |
commit | ce3d10933a3e2e1d2cb3b9ae91b6b945f189bb90 (patch) | |
tree | 2ccdafc605f8da3e5ca5c024cec1b7a1cf97f9d4 | |
parent | 8b312bb9a795c9c07661aee7b694cbfd3217e25c (diff) | |
download | linux-ce3d10933a3e2e1d2cb3b9ae91b6b945f189bb90.tar.xz |
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.
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-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 | 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 979d2e4..0ad0263 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; |