diff options
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/android/ion/ion_page_pool.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/staging/android/ion/ion_page_pool.c b/drivers/staging/android/ion/ion_page_pool.c index c1cea42b0510..5864f3dfcbc6 100644 --- a/drivers/staging/android/ion/ion_page_pool.c +++ b/drivers/staging/android/ion/ion_page_pool.c @@ -21,6 +21,7 @@ #include <linux/list.h> #include <linux/module.h> #include <linux/slab.h> +#include <linux/swap.h> #include "ion_priv.h" static void *ion_page_pool_alloc_pages(struct ion_page_pool *pool) @@ -118,7 +119,10 @@ int ion_page_pool_shrink(struct ion_page_pool *pool, gfp_t gfp_mask, int freed; bool high; - high = !!(gfp_mask & __GFP_HIGHMEM); + if (current_is_kswapd()) + high = 1; + else + high = !!(gfp_mask & __GFP_HIGHMEM); if (nr_to_scan == 0) return ion_page_pool_total(pool, high); |