ANDROID: mm: do not count cma_alloc_fail on __GFP_NORETRY

Do not account __GFP_NORETRY allocation failure as cma_alloc_fail
since it's not critical failure(i.e., the caller with __GFP_NORETRY
should always carry on the fallback plan). It's also good for
compatibility POV with upstream since upstream cma_alloc_fail
only counts cma_alloc_fail with !__GFP_NORETRY since upstream
doesn't support __GFP_NORTRY yet.

Bug: 220669548
Signed-off-by: Minchan Kim <minchan@google.com>
Change-Id: I377e6b033c3786e10b6b1c814037a4fc40e20a73
Signed-off-by: Richard Chang <richardycc@google.com>
(cherry picked from commit 8ffc7ff817fe552592daa2b0de1760e3539663f3)
This commit is contained in:
Minchan Kim
2022-02-25 16:43:25 -08:00
committed by Richard Chang
parent bb7b81497d
commit dd887dbfaa

View File

@@ -574,7 +574,7 @@ out:
if (page) { if (page) {
count_vm_event(CMA_ALLOC_SUCCESS); count_vm_event(CMA_ALLOC_SUCCESS);
cma_sysfs_account_success_pages(cma, count); cma_sysfs_account_success_pages(cma, count);
} else { } else if (!(gfp_mask & __GFP_NORETRY)) {
count_vm_event(CMA_ALLOC_FAIL); count_vm_event(CMA_ALLOC_FAIL);
if (cma) if (cma)
cma_sysfs_account_fail_pages(cma, count); cma_sysfs_account_fail_pages(cma, count);