提交 e79579f5 编写于 作者: B Baolin Wang 提交者: Jian Zhang

mm: cma: use pr_err_ratelimited for CMA warning

mainline inclusion
from mainline-v5.13
commit 63f83b31
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I63SDZ
CVE: NA

-------------------------------

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: https://lkml.kernel.org/r/ce2251ef49e1727a9a40531d1996660b05462bd2.1615279825.git.baolin.wang@linux.alibaba.comSigned-off-by: NBaolin Wang <baolin.wang@linux.alibaba.com>
Reviewed-by: NDavid Hildenbrand <david@redhat.com>
Acked-by: NMinchan Kim <minchan@kernel.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 b27291b7
...@@ -486,8 +486,8 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align, ...@@ -486,8 +486,8 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align,
} }
if (ret && !no_warn) { if (ret && !no_warn) {
pr_err("%s: alloc failed, req-size: %zu pages, ret: %d\n", pr_err_ratelimited("%s: alloc failed, req-size: %zu pages, ret: %d\n",
__func__, count, ret); __func__, count, ret);
cma_debug_show_areas(cma); cma_debug_show_areas(cma);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册