ANDROID: ion_system_heap: Add __GFP_NOWARN to mid-order allocations

When testing ION, we often see warnings in dmesg where a
mid-order allocation failed. The logic will always fall back to
lower-order allocations (there is no strict need to return
contiguous pages) so these warnings are distracting noise.

To solve this, this patch adds the __GFP_NOWARN flag to all
mid-order allocations.

Signed-off-by: John Stultz <john.stultz@linaro.org>
Bug: 177702259
Change-Id: Id4c6f2435afd9e386afba280a7f05f2bab551484
This commit is contained in:
John Stultz 2021-09-14 20:27:21 +00:00
parent 77e911a101
commit c060961254

View File

@ -238,6 +238,14 @@ static int ion_system_heap_create_pools(struct ion_page_pool **pools)
struct ion_page_pool *pool;
gfp_t gfp_flags = low_order_gfp_flags;
/*
* Enable NOWARN on larger order allocations, as
* we will fall back to 0-order if things fail.
* This avoids warning noise in dmesg.
*/
if (orders[i] > 0)
gfp_flags |= __GFP_NOWARN;
if (orders[i] > 4)
gfp_flags = high_order_gfp_flags;