diff options
authorBaolin Wang <>2021-05-04 18:37:22 -0700
committerLinus Torvalds <>2021-05-05 11:27:24 -0700
commit63f83b31f4f36d933e13bd8b9a25d6d9a0cf89dd (patch)
parentbbb269206f3c914d4f23e023de4ec020abea6d1b (diff)
mm: cma: use pr_err_ratelimited for CMA warning
If we did not reserve extra CMA memory, the log buffer can be easily filled up by CMA failure warning when the devices calling dmam_alloc_coherent() to alloc DMA memory. Thus we can use pr_err_ratelimited() instead to reduce the duplicate CMA warning. Link: Signed-off-by: Baolin Wang <> Reviewed-by: David Hildenbrand <> Acked-by: Minchan Kim <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/cma.c b/mm/cma.c
index b44a71eb3174..a862ff8c23ce 100644
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -500,8 +500,8 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align,
if (ret && !no_warn) {
- pr_err("%s: %s: alloc failed, req-size: %zu pages, ret: %d\n",
- __func__, cma->name, count, ret);
+ pr_err_ratelimited("%s: %s: alloc failed, req-size: %zu pages, ret: %d\n",
+ __func__, cma->name, count, ret);