[PATCH][SRU Disco] UBUNTU: SAUCE: cma: ratelimit cma_alloc error messages

dann frazier dann.frazier at canonical.com
Tue May 7 17:01:41 UTC 2019

BugLink: https://bugs.launchpad.net/bugs/1828092

We're seeing on the order of 10K cma_alloc() failure messages on
certain systems (HiSilicon D06 w/ SMMU BIOS-disabled, HP m400s).
While we continue to try and identify a solution that avoids
these messages altogether, in the meantime let's lessen the impact
(slow boot time, etc) by ratelimiting these messages. On a D06
w/ SMMU disabled, this drops the error messages count from 10758 to

Signed-off-by: dann frazier <dann.frazier at canonical.com>
 mm/cma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/cma.c b/mm/cma.c
index c7b39dd3b4f65..56d2a046f689e 100644
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -477,7 +477,7 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align,
 			page_kasan_tag_reset(page + i);
-	if (ret && !no_warn) {
+	if (ret && !no_warn && printk_ratelimit()) {
 		pr_err("%s: alloc failed, req-size: %zu pages, ret: %d\n",
 			__func__, count, ret);

More information about the kernel-team mailing list