From c060961254a16363567cd1ea3fb1f15a38be56b7 Mon Sep 17 00:00:00 2001 From: John Stultz Date: Tue, 14 Sep 2021 20:27:21 +0000 Subject: [PATCH] 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 Bug: 177702259 Change-Id: Id4c6f2435afd9e386afba280a7f05f2bab551484 --- drivers/staging/android/ion/heaps/ion_system_heap.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/staging/android/ion/heaps/ion_system_heap.c b/drivers/staging/android/ion/heaps/ion_system_heap.c index d76595ecedb5..706bd402509d 100644 --- a/drivers/staging/android/ion/heaps/ion_system_heap.c +++ b/drivers/staging/android/ion/heaps/ion_system_heap.c @@ -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;