From 12f48605e86dc9439cc4f0413eb07984f93927a3 Mon Sep 17 00:00:00 2001 From: Minchan Kim Date: Tue, 13 Jul 2021 08:56:06 -0700 Subject: [PATCH] ANDROID: mm: cma do not sleep for __GFP_NORETRY Do not sleep for retrying for __GFP_NORERY since it's failfast mode approach. User could retry the allocation without the flag by themselves if they see the failure. Bug: 192475091 Signed-off-by: Minchan Kim Change-Id: Ic6a857978fda8e353b9ed770d1e0ba1808fd201e --- mm/cma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/cma.c b/mm/cma.c index 0df6554bf0fc..47538607045e 100644 --- a/mm/cma.c +++ b/mm/cma.c @@ -477,7 +477,8 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align, if ((num_attempts < max_retries) && (ret == -EBUSY)) { mutex_unlock(&cma->lock); - if (fatal_signal_pending(current)) + if (fatal_signal_pending(current) || + (gfp_mask & __GFP_NORETRY)) break; /*