summaryrefslogtreecommitdiffstats
path: root/mm/cma.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/cma.c')
-rw-r--r--mm/cma.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mm/cma.c b/mm/cma.c
index d1a4c06b5039..2380f2571eb5 100644
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -511,10 +511,14 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align,
pr_debug("%s(): returned %p\n", __func__, page);
out:
- if (page)
+ if (page) {
count_vm_event(CMA_ALLOC_SUCCESS);
- else
+ cma_sysfs_account_success_pages(cma, count);
+ } else {
count_vm_event(CMA_ALLOC_FAIL);
+ if (cma)
+ cma_sysfs_account_fail_pages(cma, count);
+ }
return page;
}