lkml.org 
[lkml]   [2018]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2] ION: Sys_heap: fix the incorrect pool->gfp_mask setting
Date
The gfp_mask low order pool is overlapped by the high order
inside the loop, so the gfp_mask of all pools are set to
high_order_gfp_flags. And all the allcations will have no __GFP_RECLAIM
flag, we will easily get the allocation failure problem with
memory presure.

Changes since v1:
1. fix the tag
2. change the flags define based on the comment.

Fixes: e7f63771b60e ("ION: Sys_heap: Add cached pool to spead up cached buffer alloc")
Signed-off-by: Zeng Tao <prime.zeng@hisilicon.com>
---
drivers/staging/android/ion/ion_system_heap.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c
index 4dc5d7a..12d0801 100644
--- a/drivers/staging/android/ion/ion_system_heap.c
+++ b/drivers/staging/android/ion/ion_system_heap.c
@@ -305,6 +305,8 @@ static int ion_system_heap_create_pools(struct ion_page_pool **pools,

if (orders[i] > 4)
gfp_flags = high_order_gfp_flags;
+ else
+ gfp_flags = low_order_gfp_flags;

pool = ion_page_pool_create(gfp_flags, orders[i], cached);
if (!pool)
--
2.7.4
\
 
 \ /
  Last update: 2018-01-18 09:38    [W:0.068 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site